Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Query (Sorting)
Use decode function in the Order by clause, if the possible values of the column are
limited.
Please respond to ORACLE-L_at_fatcity.com
To: ORACLE-L_at_fatcity.com
cc:
Hi,
I have a table with a field aa. It is varchar2(2). The possible values
of this field are
1
2,-2,+2 3,-3,+3 4,-4,+4 5,-5,+5 6,-6,+6 7,-7,+7
Now I have to make a query with order by aa . The records should be fetched in the following order
1, 2+,2,2-, 3+,3,3-, 4+,4,4-, 5+,5,5-, 6+,6,6-, 7+,7,7-, 8 , 9 , 10
Can anyone help?
Thanks in advance
sivak
Received on Thu Feb 08 2001 - 00:47:23 CST