SORT BY

Function

This statement is used to achieve the partial sorting of tables according to fields.

Syntax

1
2
3
SELECT attr_expr_list FROM table_reference
  SORT BY col_name
  [ASC | DESC] [,col_name [ASC | DESC],...];

Keyword

Precautions

The to-be-sorted table must exist. If this statement is used to sort a table that does not exist, an error is reported.

Example

To sort the student table in ascending order of the score field in Reducer, run the following statement:

1
2
SELECT * FROM student
  SORT BY score;