pub struct AggregateExpr {
pub function: AggregateFunction,
pub column: Option<usize>,
pub distinct: bool,
pub alias: Option<String>,
}Expand description
An aggregation expression.
Fields§
§function: AggregateFunctionThe aggregation function.
column: Option<usize>Column index to aggregate (None for COUNT(*)).
distinct: boolWhether to aggregate distinct values only.
alias: Option<String>Output alias (for naming the result column).
Implementations§
Source§impl AggregateExpr
impl AggregateExpr
Sourcepub fn count_star() -> Self
pub fn count_star() -> Self
Creates a COUNT(*) expression.
Sourcepub fn with_distinct(self) -> Self
pub fn with_distinct(self) -> Self
Sets the distinct flag.
Sourcepub fn with_alias(self, alias: impl Into<String>) -> Self
pub fn with_alias(self, alias: impl Into<String>) -> Self
Sets the output alias.
Trait Implementations§
Source§impl Clone for AggregateExpr
impl Clone for AggregateExpr
Source§fn clone(&self) -> AggregateExpr
fn clone(&self) -> AggregateExpr
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 moreAuto Trait Implementations§
impl Freeze for AggregateExpr
impl RefUnwindSafe for AggregateExpr
impl Send for AggregateExpr
impl Sync for AggregateExpr
impl Unpin for AggregateExpr
impl UnwindSafe for AggregateExpr
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