This statement is used to achieve the partial sorting of tables according to fields.
1 2 3 | SELECT attr_expr_list FROM table_reference SORT BY col_name [ASC | DESC] [,col_name [ASC | DESC],...]; |
The to-be-sorted table must exist. If this statement is used to sort a table that does not exist, an error is reported.
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; |