I have 1 table with 6 columns all are tinyint with 1 digit. I need a query to return the data sorted (ordered) desc in each column.
example:
col1 col2 col3
1 2 5
1 7 3
2 3 7
expected result:
2 7 7
1 3 5
1 2 3
I tried order by col1, col2 DESC but it only affects the first column (maybe because it's from the same table?) thx, Danny
orderworks on a row basis. e.g.order by a,b,c. only when multiple rows inahave the same value will it start ordering byb, and then only start oncwhen multiple values of b are encountered.order bywill NOT rearrange values so that they change the rows they're in.