SELECT
Translation specification for the SELECT statement in BigQuery
Description
Syntax
[ WITH [ RECURSIVE ] { non_recursive_cte | recursive_cte }[, ...] ]
{ select | ( query_expr ) | set_operation }
[ ORDER BY expression [{ ASC | DESC }] [, ...] ]
[ LIMIT count [ OFFSET skip_rows ] ]
select:
SELECT
[ WITH differential_privacy_clause ]
[ { ALL | DISTINCT } ]
[ AS { STRUCT | VALUE } ]
select_list
[ FROM from_clause[, ...] ]
[ WHERE bool_expression ]
[ GROUP BY group_by_specification ]
[ HAVING bool_expression ]
[ QUALIFY bool_expression ]
[ WINDOW window_clause ]
select_list:
{ select_all | select_expression } [, ...]
select_all:
[ expression. ]*
[ EXCEPT ( column_name [, ...] ) ]
[ REPLACE ( expression [ AS ] column_name [, ...] ) ]
select_expression:
expression [ [ AS ] alias ]Sample Source Patterns
Setup data
BigQuery
Snowflake
WITH cte
BigQuery
Snowflake
WITH RECURSIVE cte
BigQuery
Snowflake
UNION ALL
BigQuery
Snowflake
UNION DISTINCT
BigQuery
Snowflake
INTERSECT
BigQuery
Snowflake
EXCEPT
BigQuery
Snowflake
ORDER BY
BigQuery
Snowflake
LIMIT
BigQuery
Snowflake
SELECT ALL
BigQuery
Snowflake
SELECT DISTINCT
BigQuery
Snowflake
WHERE
BigQuery
Snowflake
GROUP BY
BigQuery
Snowflake
HAVING
BigQuery
Snowflake
QUALIFY
BigQuery
Snowflake
Known Issues
Related EWIs
Last updated
Was this helpful?