pub struct Select {Show 18 fields
pub distinct: Option<Distinct>,
pub top: Option<Top>,
pub projection: Vec<SelectItem>,
pub into: Option<SelectInto>,
pub from: Vec<TableWithJoins>,
pub lateral_views: Vec<LateralView>,
pub prewhere: Option<Expr>,
pub selection: Option<Expr>,
pub group_by: GroupByExpr,
pub cluster_by: Vec<Expr>,
pub distribute_by: Vec<Expr>,
pub sort_by: Vec<Expr>,
pub having: Option<Expr>,
pub named_window: Vec<NamedWindowDefinition>,
pub qualify: Option<Expr>,
pub window_before_qualify: bool,
pub value_table_mode: Option<ValueTableMode>,
pub connect_by: Option<ConnectBy>,
}
Expand description
A restricted variant of SELECT
(without CTEs/ORDER BY
), which may
appear either as the only body item of a Query
, or as an operand
to a set operation like UNION
.
Fields§
§distinct: Option<Distinct>
§top: Option<Top>
MSSQL syntax: TOP (<N>) [ PERCENT ] [ WITH TIES ]
projection: Vec<SelectItem>
projection expressions
into: Option<SelectInto>
INTO
from: Vec<TableWithJoins>
FROM
lateral_views: Vec<LateralView>
LATERAL VIEWs
prewhere: Option<Expr>
ClickHouse syntax: PREWHERE a = 1 WHERE b = 2
,
and it can be used together with WHERE selection.
selection: Option<Expr>
WHERE
group_by: GroupByExpr
GROUP BY
cluster_by: Vec<Expr>
CLUSTER BY (Hive)
distribute_by: Vec<Expr>
DISTRIBUTE BY (Hive)
sort_by: Vec<Expr>
SORT BY (Hive)
having: Option<Expr>
HAVING
named_window: Vec<NamedWindowDefinition>
WINDOW AS
qualify: Option<Expr>
QUALIFY (Snowflake)
window_before_qualify: bool
The positioning of QUALIFY and WINDOW clauses differ between dialects. e.g. BigQuery requires that WINDOW comes after QUALIFY, while DUCKDB accepts WINDOW before QUALIFY. We accept either positioning and flag the accepted variant.
value_table_mode: Option<ValueTableMode>
BigQuery syntax: SELECT AS VALUE | SELECT AS STRUCT
connect_by: Option<ConnectBy>
STARTING WITH .. CONNECT BY
Trait Implementations§
source§impl Ord for Select
impl Ord for Select
source§impl PartialOrd for Select
impl PartialOrd for Select
source§impl VisitMut for Select
impl VisitMut for Select
fn visit<V>(&mut self, visitor: &mut V) -> ControlFlow<<V as VisitorMut>::Break>where
V: VisitorMut,
impl Eq for Select
impl StructuralPartialEq for Select
Auto Trait Implementations§
impl Freeze for Select
impl RefUnwindSafe for Select
impl Send for Select
impl Sync for Select
impl Unpin for Select
impl UnwindSafe for Select
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more