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: Sybrand Bakker <postbus_at_sybrandb.demon.nl>
Date: Wed, 13 Jul 2005 09:08:25 +0200
Message-ID: <pdf9d11maeq5da9omjc31pcft0o4v80940@4ax.com>


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
Received on Wed Jul 13 2005 - 02:08:25 CDT

Original text of this message

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