I have a column which can take any values from 0 to 100.
Now i have a type TYPE1 which can take values 2, 4, 16
TYPE2 which can take values 8,12,64.
Now i want to sort the column by TYPE1 values first and then TYPE2 values. Is there any way to do that.
My column has only these values. It does not know the Type1 or Type2. I am using SQL2005
NOTE: TYPE1 and TYPE2 are not columns. They are just logical entities.
You can specify both columns in
ORDER BYcaluse:This would by default sort the fields in ascending order. If you want to order in reverse, you can use
DESCkeyword just after column names.