11.4. Sorting¶
So far, we’ve only looked at rows of data in the order of the query is
returning to us. What if we want to see the rows in a certain sorting
order? We use the ORDER BY
command to sort them by some other
criteria.
For example, to see the bike trips in the order of the duration in seconds:
Well, it turns out by default the sorting order is ascending. To
sort the rows in descending order, add the keyword DESC
.
Of course, we can mix WHERE
and ORDER BY
, to get only the bike
trips from Member type of Casual in the order of the duration.
11.4.1. Practice Exercises¶
You have attempted of activities on this page