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

Re: Ordering

From: Lothar Armbüster <lothar.armbruester_at_rheingau.netsurf.de>
Date: 2000/04/17
Message-ID: <832.142T799T11762870lothar.armbruester@rheingau.netsurf.de>#1/1

David BARATTE wrote at 17-Apr-00 09:34:19  on the subject Ordering:
>Hello,
 

>Is it possible to select rows in a specified order in another way that
>"ORDER BY [column_name | column_pos] [ASC | DESC"]
 

>e.g : ORDER BY column_name (1, 3, 2, ...)
>where 1, 3, 2 ... are the possible values of column_name
>and 1,3,2 is the given order.

You could use an order by on a decode. Something like this:

select * from your_table
order by decode (a_column,1,1,2,3,3,2,5);

Eventually, you have to modify the syntax slightly since I did not check it.
You may want to experiment with function based indexes because the above SQL doesn't look very performant...

Hope that helps,
Lothar

-- 
Lothar Armbrüster       | lothar.armbruester_at_rheingau.netsurf.de
Hauptstr. 26            | lothar.armbruester_at_t-online.de
D-65346 Eltville        |
Received on Mon Apr 17 2000 - 00:00:00 CDT

Original text of this message

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