pub enum WindowFunction {
RowNumber,
Rank,
DenseRank,
Lag {
column: ColumnName,
offset: usize,
},
Lead {
column: ColumnName,
offset: usize,
},
FirstValue {
column: ColumnName,
},
LastValue {
column: ColumnName,
},
}Expand description
Window function operations supported by the engine.
ROW_NUMBER / RANK / DENSE_RANK are pure ranking functions
(no args). LAG / LEAD look at a sibling row offset
(default 1). FIRST_VALUE / LAST_VALUE return the column at
the partition boundary.
Variants§
RowNumber
Rank
DenseRank
Lag
LAG(column, offset = 1) — value offset rows back, NULL
if before partition start.
Lead
LEAD(column, offset = 1) — value offset rows forward,
NULL if past partition end.
FirstValue
FIRST_VALUE(column) — value of column at the first row
of the current partition (under the ORDER BY).
Fields
column: ColumnNameLastValue
LAST_VALUE(column) — value of column at the last row
of the current partition. Per ANSI default frame, “last
row” here means the current row — so we treat
LAST_VALUE with no explicit frame as “value of column on
the current row”. Postgres parity in tests/.
Fields
column: ColumnNameImplementations§
Source§impl WindowFunction
impl WindowFunction
Sourcepub fn default_alias(&self) -> &'static str
pub fn default_alias(&self) -> &'static str
Output column name when no alias is present.
Trait Implementations§
Source§impl Clone for WindowFunction
impl Clone for WindowFunction
Source§fn clone(&self) -> WindowFunction
fn clone(&self) -> WindowFunction
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more