d0ad381833
* test: add spark query unit test and check grammar * test: add select explain、lateralSubQuery、transform unit test * chore: fileName exchange --------- Co-authored-by: dilu <dilu@dtstack.com>
18 lines
718 B
SQL
18 lines
718 B
SQL
-- ORDER BY { expression [ sort_direction | nulls_sort_order ] [ , ... ] }
|
|
|
|
-- Sort rows by age. By default rows are sorted in ascending manner with NULL FIRST.
|
|
SELECT name, age FROM person ORDER BY age;
|
|
|
|
-- Sort rows in ascending manner keeping null values to be last.
|
|
SELECT name, age FROM person ORDER BY age NULLS LAST;
|
|
|
|
-- Sort rows by age in descending manner, which defaults to NULL LAST.
|
|
SELECT name, age FROM person ORDER BY age DESC;
|
|
|
|
-- Sort rows in ascending manner keeping null values to be first.
|
|
SELECT name, age FROM person ORDER BY age DESC NULLS FIRST;
|
|
|
|
-- Sort rows based on more than one column with each column having different
|
|
-- sort direction.
|
|
SELECT * FROM person ORDER BY name ASC, age DESC;
|