0
I think you mean order by multiple attributes in a single order by. It is easy once you know it. The ORDER BY sorts the records by the attributes/column you pass to it. If you pass two or more separated with comma, they will be secondary, trinary.. etc.. ordering attributes.
Imagine you store wehicles inside your database. Now you order by: speed, wheel_count. The list you get will contain your wehicles in order, from the slowest to the fastest. But what if two have the same speed? Which one gets ahead, which is before amd which is after? The second attribute you passed (wheel_count) will decide.
So if you have slow/fast speeds and you store motorbikes and cars, your order for 'order by speed, wheels' will be:
- slow motorbikes
- slow cars
- fast motorbikes
- fast cars
So, as you see, the items are ordered primary by speed, and secondary by number of wheels (both ascending). If you wish to order from high to low insert 'desc' for 'descending' after the attribute name, like: ORDER BY speed desc, wheels