select
decode(substr(col1,1,1),'+',substr(col1,2,1)||'+','-',substr(col1,2,1)||'-',
col1) from test
order by
to_number(decode(substr(col1,1,1),'+',substr(col1,2,1),'-',substr(col1,2,1),
col1))
/


This will do the thing

Regards
Arun Aggarwal
Aithent Technologies (P) Ltd.
[EMAIL PROTECTED]
+91-11-6920905 (35)

"If I knew what I was so anxious about, I wouldn't be so anxious."
--Mignon McLaughlin

----- Original Message -----
To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]>
Sent: Thursday, February 08, 2001 11:20


> 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
>


-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Arun Aggarwal
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to