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 09:11:10 +0200
Message-ID: <db2epq$9f7$01$1@news.t-online.com>


Sybrand Bakker wrote:

> On Wed, 13 Jul 2005 08:56:28 +0200, Maxim Demenko <mdemenko_at_gmail.com>
> wrote:
> 
> 

>>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
> 
> 
> I assume you intended to write 'even' instead of 'ever'.
> This may well be a viable solution for the OP.
> 
> 
> --
> Sybrand Bakker, Senior Oracle DBA

Sorry, you are of course right.

Best regards

Maxim Received on Wed Jul 13 2005 - 02:11:10 CDT

Original text of this message

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