pub struct GroupBy {
pub groups: Vec<Expr>,
pub distinct: bool,
pub with: Option<GroupByWith>,
}Expand description
GROUP BY [DISTINCT] a, b [WITH ROLLUP]
GROUP BY [ ALL | DISTINCT ] grouping_element [, ...] -- PostgreSQL 17
GROUP BY expr [, ...] [WITH ROLLUP] -- MySQL 8.4ALL is the default and writing it adds nothing, so only DISTINCT is
representable.
Fields§
§groups: Vec<Expr>The grouping elements. A GroupingSet is one of these.
distinct: boolPostgreSQL’s GROUP BY DISTINCT, which de-duplicates the grouping sets a
CUBE or ROLLUP expands to.
with: Option<GroupByWith>MySQL’s WITH ROLLUP.
Implementations§
Source§impl GroupBy
impl GroupBy
Sourcepub fn set_groups(&mut self, groups: impl IntoExprList)
pub fn set_groups(&mut self, groups: impl IntoExprList)
Replace the grouping elements.
Sourcepub fn append_group(&mut self, group: impl IntoExpr)
pub fn append_group(&mut self, group: impl IntoExpr)
Append one grouping element.
Trait Implementations§
Source§impl Expression for GroupBy
impl Expression for GroupBy
Source§impl HasGroupBy for GroupBy
impl HasGroupBy for GroupBy
Source§fn group_by_mut(&mut self) -> &mut GroupBy
fn group_by_mut(&mut self) -> &mut GroupBy
The
GROUP BY clause to modify.Auto Trait Implementations§
impl !RefUnwindSafe for GroupBy
impl !UnwindSafe for GroupBy
impl Freeze for GroupBy
impl Send for GroupBy
impl Sync for GroupBy
impl Unpin for GroupBy
impl UnsafeUnpin for GroupBy
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