Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: SQL Query (Sorting)

Re: SQL Query (Sorting)

From: <saji.rajp_at_db.com>
Date: Wed, 07 Feb 2001 22:47:23 -0800
Message-ID: <F001.002AE8EB.20010207221521@fatcity.com>


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

8
9
10

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US