Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: reorganize More Select Syntax section

Table of Contents

GROUP BYSORT BY, ORDER BY, CLUSTER BY, DISTRIBUTE BYJOIN (Hive JoinsJoin OptimizationOuter Join Behavior); UNIONTABLESAMPLESubqueriesVirtual ColumnsOperators and UDFsLATERAL VIEWWindowing, OVER, and AnalyticsCommon Table Expressions

Select Syntax

Code Block
[WITH CommonTableExpression (, CommonTableExpression)*]    (Note: Only available starting with Hive 0.13.0)
SELECT [ALL | DISTINCT] select_expr, select_expr, ...
  FROM table_reference
  [WHERE where_condition]
  [GROUP BY col_list]
  [ORDER BY col_list]
  [CLUSTER BY col_list
    | [DISTRIBUTE BY col_list] [SORT BY col_list]
  ]
 [LIMIT number]

...

See the following documents for additional syntax and features of SELECT statements: