Last active
December 22, 2015 23:59
-
-
Save RhodiumToad/6550462 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ LATERAL ] ( select ) [ AS ] alias [ ( column_alias [, ...] ) ] | |
with_query_name [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ LATERAL ] function_name ( [ argument [, ...] ] ) [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ LATERAL ] TABLE( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ] ) [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ LATERAL ] function_name ( [ argument [, ...] ] ) [ AS ] alias ( column_definition [, ...] ) | |
[ LATERAL ] function_name ( [ argument [, ...] ] ) AS ( column_definition [, ...] ) | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ 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 ] TABLE( function_call [ AS ( column_definition [, ...] ) ] [, function_call [ AS ( column_definition [, ...] ) ] [, ...] ] ) [ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ 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 ] TABLE( function_call [ AS ( column_definition [, ...] ) ] | |
[, function_call [ AS ( column_definition [, ...] ) ] [, ...] ] ) | |
[ WITH ORDINALITY ] | |
[ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ 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 ] TABLE( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] | |
[, function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ] ) | |
[ WITH ORDINALITY ] | |
[ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ 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 ] TABLE( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] | |
[, function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] | |
[, ...] ] ) [ WITH ORDINALITY ] | |
[ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postgres=# \h select | |
Command: SELECT | |
Description: retrieve rows from a table or view | |
Syntax: | |
[ WITH [ RECURSIVE ] with_query [, ...] ] | |
SELECT [ ALL | DISTINCT [ ON ( expression [, ...] ) ] ] | |
* | expression [ [ AS ] output_name ] [, ...] | |
[ FROM from_item [, ...] ] | |
[ WHERE condition ] | |
[ GROUP BY expression [, ...] ] | |
[ 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 } ] | |
[ OFFSET start [ ROW | ROWS ] ] | |
[ FETCH { FIRST | NEXT } [ count ] { ROW | ROWS } ONLY ] | |
[ FOR { UPDATE | NO KEY UPDATE | SHARE | KEY SHARE } [ OF table_name [, ...] ] [ NOWAIT ] [...] ] | |
where from_item can be one of: | |
[ ONLY ] table_name [ * ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
[ 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 ] TABLE( function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] | |
[, function_name ( [ argument [, ...] ] ) [ AS ( column_definition [, ...] ) ] [, ...] ] ) | |
[ WITH ORDINALITY ] [ [ AS ] alias [ ( column_alias [, ...] ) ] ] | |
from_item [ NATURAL ] join_type from_item [ ON join_condition | USING ( join_column [, ...] ) ] | |
and with_query is: | |
with_query_name [ ( column_name [, ...] ) ] AS ( select | values | insert | update | delete ) | |
TABLE [ ONLY ] table_name [ * ] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment