pub struct Select {Show 24 fields
pub select_token: AttachedToken,
pub optimizer_hint: Option<OptimizerHint>,
pub distinct: Option<Distinct>,
pub select_modifiers: Option<SelectModifiers>,
pub top: Option<Top>,
pub top_before_distinct: bool,
pub projection: Vec<SelectItem>,
pub exclude: Option<ExcludeSelectItem>,
pub into: Option<SelectInto>,
pub from: Vec<TableWithJoins>,
pub lateral_views: Vec<LateralView>,
pub prewhere: Option<Expr>,
pub selection: Option<Expr>,
pub connect_by: Vec<ConnectByKind>,
pub group_by: GroupByExpr,
pub cluster_by: Vec<Expr>,
pub distribute_by: Vec<Expr>,
pub sort_by: Vec<OrderByExpr>,
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 flavor: SelectFlavor,
}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§
§select_token: AttachedTokenToken for the SELECT keyword
optimizer_hint: Option<OptimizerHint>§distinct: Option<Distinct>SELECT [DISTINCT] ...
select_modifiers: Option<SelectModifiers>MySQL-specific SELECT modifiers.
See MySQL SELECT.
top: Option<Top>MSSQL syntax: TOP (<N>) [ PERCENT ] [ WITH TIES ]
top_before_distinct: boolWhether the top was located before ALL/DISTINCT
projection: Vec<SelectItem>projection expressions
exclude: Option<ExcludeSelectItem>Excluded columns from the projection expression which are not specified directly after a wildcard.
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
connect_by: Vec<ConnectByKind>[START WITH ..] CONNECT BY ..
group_by: GroupByExprGROUP BY
cluster_by: Vec<Expr>CLUSTER BY (Hive)
distribute_by: Vec<Expr>DISTRIBUTE BY (Hive)
sort_by: Vec<OrderByExpr>SORT BY (Hive)
having: Option<Expr>HAVING
named_window: Vec<NamedWindowDefinition>WINDOW AS
qualify: Option<Expr>QUALIFY (Snowflake)
window_before_qualify: boolThe 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
flavor: SelectFlavorWas this a FROM-first query?
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
Source§fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
fn visit<V: VisitorMut>(&mut self, visitor: &mut V) -> ControlFlow<V::Break>
VisitorMut. Read more