-
Notifications
You must be signed in to change notification settings - Fork 407
SELECT clause
Daniël van Eeden edited this page Mar 13, 2024
·
5 revisions
SQL standard defines the following syntax for the start of a query:
SELECT [ALL | DISTINCT]
All dialects support that, but also quite a bit extra stuff:
SELECT [ALL | DISTINCT] [AS {STRUCT | VALUE}]
SELECT [ALL | DISTINCT]
Hive:
SELECT [ALL | DISTINCT]
SELECT
[ALL | DISTINCT | DISTINCTROW]
[HIGH_PRIORITY]
[STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_CACHE | SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
SELECT
[ALL | DISTINCT | DISTINCTROW]
[HIGH_PRIORITY]
[STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
N1QL:
SELECT [hint_comment] [ALL | DISTINCT]
SELECT [hint] [ALL | DISTINCT | UNIQUE]
SELECT [ALL | DISTINCT [ON ( expression [, ...] )]]
SELECT [TOP number | [ALL | DISTINCT]]
SELECT [ALL | DISTINCT | DISTINCTROW]
SELECT [ALL | DISTINCT]
SELECT [hints, ...] [ALL | DISTINCT]
SELECT [ALL | DISTINCT]
TiDB:
SELECT
[ALL | DISTINCT | DISTINCTROW]
[HIGH_PRIORITY]
[STRAIGHT_JOIN]
[SQL_SMALL_RESULT] [SQL_BIG_RESULT] [SQL_BUFFER_RESULT]
[SQL_NO_CACHE] [SQL_CALC_FOUND_ROWS]
SELECT
[ALL | DISTINCT]
[TOP ( expression ) [PERCENT] [WITH TIES]]
SELECT [ALL | DISTINCT]