Query constructs

Clauses, operators and table syntax.

Query constructs (27)Also in the SQL reference (12)Not in the SQL reference (15)

Query constructs (27)

ConstructSupportAreaDescription
ASOF JOINsupportedQueries & DMLAn ASOF JOIN operation combines rows from two tables based on timestamp values that follow each other, precede each other, or match exactly. For each row in…
AT | BEFOREsupportedQueries & DMLThe AT or BEFORE clause is used for Snowflake Time Travel. In a query, it is specified in the FROM clause immediately after the table name, and it determines…
CHANGESsupportedQueries & DMLThe CHANGES clause enables querying the change tracking metadata for a table or view within a specified interval of time without having to create a stream with…
CONNECT BYsupportedQueries & DMLJoins a table to itself to process hierarchical data in the table. The CONNECT BY subclause of the FROM clause iterates to process the data.
FOR UPDATEsupportedQueries & DMLLocks the rows that the query selects until the transaction that contains the query commits or aborts.
FROMsupportedQueries & DMLSpecifies the tables, views, or table functions to use in a SELECT statement.
GROUP BYsupportedQueries & DMLGroups rows with the same group-by-item expressions and computes aggregate functions for the resulting group. A GROUP BY expression can be:
GROUP BY CUBEsupportedQueries & DMLGROUP BY CUBE is an extension of the GROUP BY clause, similar to GROUP BY ROLLUP. Like ROLLUP, CUBE produces aggregated rows at multiple levels. However, while…
GROUP BY GROUPING SETSsupportedQueries & DMLGROUPING SETS is a powerful extension of the GROUP BY clause that computes multiple GROUP BY clauses in a single statement. A grouping set is a set of…
GROUP BY ROLLUPsupportedQueries & DMLGROUP BY ROLLUP is an extension of the GROUP BY clause that produces aggregated rows at multiple levels of a hierarchy (in addition to the detailed grouped…
HAVINGsupportedQueries & DMLFilters rows produced by GROUP BY that do not satisfy a predicate.
INTOsupportedQueries & DMLSets Snowflake Scripting variables to the values in a row returned by a SELECT statement. See Setting variables to the results of a SELECT statement for…
JOINsupportedQueries & DMLA JOIN operation combines rows from two tables — or other table-like sources, such as views or table functions — to create a new combined row that can be used…
LATERALsupportedQueries & DMLIn a FROM clause, the LATERAL keyword allows an inline view to reference columns from a table expression that precedes that inline view.
LIMIT / FETCHsupportedQueries & DMLConstrains the maximum number of rows returned by a statement or subquery. Both LIMIT (PostgreSQL syntax) and FETCH (ANSI syntax) are supported, and produce…
MATCH_RECOGNIZEsupportedQueries & DMLRecognizes matches of a pattern in a set of rows. MATCH_RECOGNIZE accepts a set of rows (from a table, view, subquery, or other source) as input, and returns…
ORDER BYsupportedQueries & DMLSpecifies an ordering of the rows of the result table from a SELECT list.
PIVOTsupportedQueries & DMLRotates a table by turning the unique values from one column in the input expression into multiple columns and aggregating results where required on any…
QUALIFYsupportedQueries & DMLIn a SELECT statement, the QUALIFY clause filters the results of window functions.
RESAMPLEpreviewsupportedQueries & DMLReturns a data set that includes both input rows and generated rows for missing data points, given a user-defined time-based granularity.
SAMPLE / TABLESAMPLEsupportedQueries & DMLReturns a subset of rows sampled randomly from the specified table. You can specify different types of sampling methods, and you can sample a fraction of a…
SEMANTIC_VIEWsupportedQueries & DMLSpecifies the semantic view to query. You specify SEMANTIC_VIEW(…) in a FROM clause in a SELECT statement.
TOP <N>supportedQueries & DMLConstrains the maximum number of rows returned by a statement or subquery.
UNPIVOTsupportedQueries & DMLRotates a table by transforming columns into rows. UNPIVOT is a relational operator that accepts two columns (from a table or subquery), along with a list of…
VALUESsupportedQueries & DMLIn the SELECT statement, the VALUES subclause of the FROM clause lets you specify a set of constants to form a finite set of rows.
WHEREsupportedQueries & DMLThe WHERE clause specifies a condition that acts as a filter. You can use the WHERE clause to:
WITHsupportedQueries & DMLThe WITH clause is an optional clause that precedes the body of the SELECT statement, and defines one or more CTEs (common table expressions) that can be used…

Also in the SQL reference (12)

Listed in the SQL reference without their own page; counted in coverage.

NameSupportArea
:supportedQueries & DML
::supportedQueries & DML
BETWEENsupportedQueries & DML
ILIKEsupportedQueries & DML
ILIKE ANYsupportedQueries & DML
INsupportedQueries & DML
IS DISTINCT FROMsupportedQueries & DML
IS NULLsupportedQueries & DML
LIKEsupportedQueries & DML
LIKE ALLsupportedQueries & DML
LIKE ANYsupportedQueries & DML
||supportedQueries & DML

Not in the SQL reference (15)

Features tracked at a finer grain than the reference. Not counted in the coverage figure.

NameSupportArea
Recursive CTEs (WITH RECURSIVE)supportedQueries & DML
Window functions (OVER)supportedQueries & DML
GROUP BY ALLsupportedQueries & DML
DISTINCTsupportedQueries & DML
NATURAL JOINsupportedQueries & DML
FLATTENsupportedQueries & DML
TABLE(...) table functionssupportedQueries & DML
Set operators (UNION / INTERSECT / EXCEPT / MINUS)supportedQueries & DML
Subqueries (IN / EXISTS / ANY / ALL)supportedQueries & DML
INTERVAL literalssupportedQueries & DML
IDENTIFIER(...)supportedQueries & DML
Positional column references ($1)supportedQueries & DML
SELECT * EXCLUDE / RENAME / REPLACEsupportedQueries & DML
WITHIN GROUP (ordered-set aggregates)supportedQueries & DML
Session variables ($var / SET)supportedQueries & DML