Order By
ORDER_BY selectedPropertiesList (ASC | DESC)?
The order by command allows you to specify the order in which the data should be returned, as performed by the database. By default, the values are sorted in ascending (ASC) order. This order can be reversed using the DESC token.
As an example, the statement select student from Student as student order by student.firstName returns the students sorted by first name, starting with the letter A, whereas the statement select student from Student as student order by student.firstName desc returns the students starting with the letter Z.
The ordering is performed by the database, and the precise results are dependent on its sorting mechanisms.
 |