pub struct Fetch {
pub count: Option<Expr>,
pub first_or_next: FirstOrNext,
pub rows: RowsKeyword,
pub with_ties: bool,
}Expand description
FETCH { FIRST | NEXT } n { ROW | ROWS } { ONLY | WITH TIES } — the
SQL-standard spelling of LIMIT, and the only one that can ask for ties.
From PostgreSQL 17:
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } { ONLY | WITH TIES } ]FIRST/NEXT and ROW/ROWS are pure synonyms in the grammar, but not on
the page: which one a query says is visible whenever generated SQL is read or
diffed against a hand-written statement, so every spelling is representable.
The defaults write FETCH NEXT n ROWS. WITH TIES requires an ORDER BY,
which is the statement’s business rather than this clause’s.
Fields§
§count: Option<Expr>How many rows.
first_or_next: FirstOrNextFETCH FIRST rather than FETCH NEXT.
rows: RowsKeywordROW or ROWS, either legal whatever the count.
with_ties: boolWITH TIES rather than ONLY: also return rows that tie with
the last one under the ORDER BY.
Implementations§
Trait Implementations§
Source§impl Expression for Fetch
impl Expression for Fetch
Auto Trait Implementations§
impl !RefUnwindSafe for Fetch
impl !UnwindSafe for Fetch
impl Freeze for Fetch
impl Send for Fetch
impl Sync for Fetch
impl Unpin for Fetch
impl UnsafeUnpin for Fetch
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more