July 2002
Beginner
424 pages
9h 30m
English
Rows in a query result are unordered; you should view the order in which rows appear as being arbitrary. This situation arises because the relational model posits that row order is irrelevant for table operations. You can use the ORDER BY clause to sort rows by a specified column or columns in ascending (lowest to highest) or descending (highest to lowest) order; see the sidebar in this section. The ORDER BY clause always is the last clause in a SELECT statement.
SELECT columns FROM table ORDER BY sort_column [ASC | DESC];
Read now
Unlock full access