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

Home -> Community -> Usenet -> c.d.o.misc -> Re: "order by" with "where value in" clause problem

Re: "order by" with "where value in" clause problem

From: Maxim Demenko <mdemenko_at_gmail.com>
Date: Wed, 13 Jul 2005 08:56:28 +0200
Message-ID: <db2du9$hl8$00$1@news.t-online.com>


Sybrand Bakker wrote:

>
> can only be done when you add a dummy column
> decode(id, 1,1,5,2,80,3,13,4,4,5,NULL) pos
> and add
> order by pos nulls last
>

> --
> Sybrand Bakker, Senior Oracle DBA

Will work ever by placing the same decode expression in the order by clause ( also without dummy column ).

select id, col1, col2, col3
from table1
where id in (1, 5, 80, 13, 4)
order by decode(id, 1,1,5,2,80,3,13,4,4,5,NULL)

Best regards

Maxim Received on Wed Jul 13 2005 - 01:56:28 CDT

Original text of this message

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