Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
SELECT key FROM (SELECT key FROM src ORDER BY key LIMIT 10)asubq1
UNION
SELECT key FROM (SELECT key FROM src1 ORDER BY key LIMIT 10)bsubq2

To apply an ORDER BY, SORT BY, CLUSTER BY or , DISTRIBUTE BY or LIMIT clause to the entire UNION result, place the ORDER BY, SORT BY, CLUSTER BY, DISTRIBUTE BY or LIMIT after the last one. The following example uses both ORDER BY and LIMIT clauses:

...