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

Home -> Community -> Usenet -> c.d.o.tools -> Re: How to display the return this way?

Re: How to display the return this way?

From: Ed prochak <ed.prochak_at_alltel.com>
Date: 14 Dec 2001 09:53:19 -0800
Message-ID: <e51b160.0112140953.3119eab3@posting.google.com>

learn the power of DECODE!

just add:

  order by decode( A,

               'A1','AA',
               'D1','BB',
               'C1','CC,
               'B1','DD', A)


This does get tedious when the list gets long. Another solution involves joining an ordering table (certain advantages to that).

Good luck!

C Chang <cschang_at_maxinter.net> wrote in message news:<3C1A1F19.1421_at_maxinter.net>...
> I have a select script such as:
>
> Select A, B
> from myTable
> where A = 'A1'
> or A = 'D1'
> or A = 'C1'
> or A = 'B1';
>
> How do I let my return display as my order in where clause:
>
> A1 Bxx
> D1 BXXX
> C1 BX
> B1 Byy
>
> but not in sorted order of column A -> A1, B1, C1, D1.
>
> C Chang
Received on Fri Dec 14 2001 - 11:53:19 CST

Original text of this message

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