pub enum WindowFunctionSpec {
Aggregate {
name: FunctionIdentifier,
args: Vec<Expression>,
filter: Option<Box<Expression>>,
},
Ranking {
name: FunctionIdentifier,
args: Vec<Expression>,
},
Value {
name: FunctionIdentifier,
args: Vec<Expression>,
},
}Expand description
Window function specification
Uses FunctionIdentifier for proper case handling in all variants.
SQL:2003 FILTER clause is supported for conditional aggregation within windows.
Variants§
Aggregate
Aggregate function used as window function Example: SUM(salary), AVG(price), COUNT() Example with FILTER: COUNT() FILTER (WHERE x > 0) OVER (PARTITION BY y)
Fields
§
name: FunctionIdentifier§
args: Vec<Expression>§
filter: Option<Box<Expression>>Optional FILTER clause for conditional aggregation
Ranking
Ranking function Example: ROW_NUMBER(), RANK(), DENSE_RANK(), NTILE(4)
Value
Value function Example: LAG(salary, 1), LEAD(price, 2), FIRST_VALUE(name), LAST_VALUE(amount)
Implementations§
Trait Implementations§
Source§impl Clone for WindowFunctionSpec
impl Clone for WindowFunctionSpec
Source§fn clone(&self) -> WindowFunctionSpec
fn clone(&self) -> WindowFunctionSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowFunctionSpec
impl Debug for WindowFunctionSpec
Source§impl PartialEq for WindowFunctionSpec
impl PartialEq for WindowFunctionSpec
Source§impl ToSql for WindowFunctionSpec
impl ToSql for WindowFunctionSpec
impl StructuralPartialEq for WindowFunctionSpec
Auto Trait Implementations§
impl Freeze for WindowFunctionSpec
impl RefUnwindSafe for WindowFunctionSpec
impl Send for WindowFunctionSpec
impl Sync for WindowFunctionSpec
impl Unpin for WindowFunctionSpec
impl UnwindSafe for WindowFunctionSpec
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