Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: How to display the return this way?
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