I am trying to sort by multiple columns in SQL, and in different directions. column1
would be sorted descending, and column2
ascending.
How
Multiple column ordering depends on both column's corresponding values: Here is my table example where are two columns named with Alphabets and Numbers and the values in these two columns are asc and desc orders.
Now I perform Order By in these two columns by executing below command:
Now again I insert new values in these two columns, where Alphabet value in ASC order:
and the columns in Example table look like this. Now again perform the same operation:
You can see the values in the first column are in desc order but second column is not in ASC order.