I'm not even sure it's possible to do this but I want to order a query based on the maximum value of one of three columns.
Example table structure: guid, column1, column2, column3
Columns 1-3 have numerical values and I want to order the select statement based on the maximum value of 1, 2 OR 3.
For example:
record column1 column2 column3
---------------------------------
1 5 0 2
2 2 0 6
3 0 1 2
Would be ordered record 2, 1, 3 because 6 is the maximum value of the three fields across the three records, record 1 is the second and record 3 is the third.
Does this make any sense?
Thanks.