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

Home -> Community -> Usenet -> c.d.o.server -> Re: cusotm sort in order by

Re: cusotm sort in order by

From: Olive Zhu <ozhu_at_asiansources.com>
Date: Wed, 04 Aug 1999 09:11:54 +0800
Message-ID: <37A79359.3F58CD1B@asiansources.com>


select a,b, decode(b,'Dog', 1,

                                'Hosrse', 2,
                                'Snake', 3,
                                'Elephant', 4 )
from T
order by 3

Nandakumar wrote:

> I like to sort the rows of a table in a custom order of a column.
> Say the table T(A,B) has values for B as
> 'Snake' 'Dog', 'Horse', 'Elephant'.
> I would want the select to list the values in the order
> 'Dog' 'Hosrse' 'Snake' 'Elephant'. (** Not in ASC or DESC orders)
>
> Would appreciate any help.
> --
> Nandakumar
> Systems Analyst
> New York
> (N.Kumar_at_rocketmail.com)
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Received on Tue Aug 03 1999 - 20:11:54 CDT

Original text of this message

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