47 lines
2.8 KiB
Plaintext
47 lines
2.8 KiB
Plaintext
[ WITH [ RECURSIVE ] $with_query$ [ , ... ] ]
|
|
SELECT [ ALL [ * | { $expression$ [ [ AS ] $output_name$ ] } [ , ... ] ] |
|
|
DISTINCT [ ON ( $expression$ [ , ... ] ) ] { * | { $expression$ [ [ AS ] $output_name$ ] } [ , ... ] } ]
|
|
[ FROM $from_item$ [ , ... ] ]
|
|
[ WHERE $condition$ ]
|
|
[ GROUP BY [ ALL | DISTINCT ] $grouping_element$ [ , ... ] ]
|
|
[ HAVING $condition$ ]
|
|
[ WINDOW { $window_name$ AS ( $window_definition$ ) } [ , ... ] ]
|
|
[ { UNION | INTERSECT | EXCEPT } [ ALL | DISTINCT ] $select$ ]
|
|
[ ORDER BY { $expression$ [ ASC | DESC | USING $operator$ ] [ NULLS { FIRST | LAST } ] } [ , ... ] ]
|
|
[ LIMIT { $count$ | ALL } | FETCH { FIRST | NEXT } [ $count$ ] { ROW | ROWS } { ONLY | WITH TIES } ]
|
|
[ OFFSET $start$ [ ROW | ROWS ] ]
|
|
[ { FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF $table_name$ [ , ... ] ] [ NOWAIT | SKIP LOCKED ] } [ ... ] ]
|
|
|
|
TABLE { ONLY $table_name$ | $table_name$ [ * ] }
|
|
|
|
where $from_item$ is:
|
|
|
|
{ ONLY $table_name$ | $table_name$ [ * ] } [ [ AS ] $alias$ [ ( $column_alias$ [ , ... ] ) ] ]
|
|
[ TABLESAMPLE $sampling_method$ ( $argument$ [ , ... ] ) [ REPEATABLE ( $seed$ ) ] ] |
|
|
[ LATERAL ] ( $select$ ) [ AS ] $alias$ [ ( $column_alias$ [ , ... ] ) ] |
|
|
$with_query_name$ [ [ AS ] $alias$ [ ( $column_alias$ [ , ... ] ) ] ] |
|
|
[ LATERAL ] $function_name$ ( [ $argument$ [ , ... ] ] )
|
|
[ WITH ORDINALITY ] [ [ AS ] $alias$ [ ( $column_alias$ [ , ... ] ) ] ] |
|
|
[ LATERAL ] $function_name$ ( [ $argument$ [ , ... ] ] ) [ AS ] $alias$ ( $column_definition$ [ , ... ] ) |
|
|
[ LATERAL ] $function_name$ ( [ $argument$ [ , ... ] ] ) AS ( $column_definition$ [ , ... ] ) |
|
|
[ LATERAL ] ROWS FROM( { $function_name$ ( [ $argument$ [ , ... ] ] ) [ AS ( $column_definition$ [ , ... ] ) ] } [ , ... ] )
|
|
[ WITH ORDINALITY ] [ [ AS ] $alias$ [ ( $column_alias$ [ , ... ] ) ] ] |
|
|
$from_item_recursive$ $join_type$ $from_item_recursive$ { ON $join_condition$ | USING ( $join_column$ [ , ... ] ) [ AS $join_using_alias$ ] } |
|
|
$from_item_recursive$ NATURAL $join_type$ $from_item_recursive$ |
|
|
$from_item_recursive$ CROSS JOIN $from_item_recursive$
|
|
|
|
where $grouping_element$ is:
|
|
|
|
( ) |
|
|
$expression$ |
|
|
( $expression$ [ , ... ] ) |
|
|
ROLLUP ( { $expression$ | ( $expression$ [ , ... ] ) } [ , ... ] ) |
|
|
CUBE ( { $expression$ | ( $expression$ [ , ... ] ) } [ , ... ] ) |
|
|
GROUPING SETS ( $grouping_element_recursive$ [ , ... ] )
|
|
|
|
where $with_query$ is:
|
|
|
|
$with_query_name$ [ ( $column_name$ [ , ... ] ) ] AS [ [ NOT ] MATERIALIZED ] ( $select$ | $values$ | $insert$ | $update$ | $delete$ )
|
|
[ SEARCH { BREADTH | DEPTH } FIRST BY $column_name$ [ , ... ] SET $search_seq_col_name$ ]
|
|
[ CYCLE $column_name$ [ , ... ] SET $cycle_mark_col_name$ [ TO $cycle_mark_value$ DEFAULT $cycle_mark_default$ ] USING $cycle_path_col_name$ ]
|