We can use the order by keyword to source results sets by one or more columns.
We can see in this example that not specifying the order method the output is automatically sorted by
I.D. in ascending order by default so you can see here that we have our basic SELECT statement where
selecting all the records from users in our echo statement and we're going to be outputting the I.D.
first name and last name.
So this is the default sort method you can see it's in ascending order by
we can change the order to a descending by using the DSC abbreviation
so if you plug that in after users and press refresh we're now sorting in descending order by I.D. we
can sort by multiple columns by specifying the column names separated by a comma.
So say for example we want to order by first name and then order by last name.
So if you add these two column names in your school statement Save the page and press refresh.
We're now sorting by first name and you can see that the second sorting is by last name.