pub struct Select {Show 13 fields
pub ctes: Vec<Cte>,
pub compound: Vec<(CompoundOp, Select)>,
pub distinct: bool,
pub columns: Vec<ResultColumn>,
pub from: Option<FromClause>,
pub where_clause: Option<Expr>,
pub group_by: Vec<Expr>,
pub having: Option<Expr>,
pub window_defs: Vec<(String, WindowSpec)>,
pub order_by: Vec<OrderTerm>,
pub limit: Option<Expr>,
pub offset: Option<Expr>,
pub values_rows: usize,
}Expand description
A SELECT query.
Fields§
§ctes: Vec<Cte>WITH common table expressions, in declaration order.
compound: Vec<(CompoundOp, Select)>Compound continuations (UNION/INTERSECT/EXCEPT …), left-associative.
The outer order_by/limit/offset apply to the whole compound.
distinct: boolSELECT DISTINCT?
columns: Vec<ResultColumn>The projected result columns.
from: Option<FromClause>The FROM clause, if any.
where_clause: Option<Expr>The WHERE predicate, if any.
group_by: Vec<Expr>GROUP BY expressions.
having: Option<Expr>HAVING predicate.
window_defs: Vec<(String, WindowSpec)>WINDOW name AS (spec) named-window definitions.
order_by: Vec<OrderTerm>ORDER BY terms.
limit: Option<Expr>LIMIT expression.
offset: Option<Expr>OFFSET expression.
values_rows: usizeWhen this select is a VALUES (…), (…), … query core, the number of
rows in that clause (≥ 1); 0 for an ordinary SELECT. The parser
desugars a multi-row VALUES into UNION ALL compound arms, so this
records how many leading compound arms (its first
values_rows - 1) are extra rows of one VALUES clause rather than true
compound continuations — which SQLite renders as a single
SCAN N-ROW VALUES CLAUSE node in EXPLAIN QUERY PLAN. Purely
informational; it does not affect execution (the UNION ALL desugaring
already has the right semantics).