Below is what I have
id | Total | Area
1 | 19 | A
2 | 20 | B
3 | 19 | C
4 | 20 | A
5 | 19 | D
What I want is as below.
id | Total | Area
4 | 20 | A
2 | 20 | B
1 | 19 | A
3 | 19 | C
5 | 19 | D
I was trying as
SELECT * FROM myTable
ORDER BY Total, Area DESC
By using above code I can sort the Total in descending order, however how to order Area column at the same time? Any idea?
I am closing this question as I got answer
SELECT * FROM myTable
ORDER BY Total DESC, Area ASC
Each column/expression in an
ORDER BYclause can have its own order (ASC/DESC,ASCis the default if not specified). You can write:Demo