Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: "order by" with "where value in" clause problem
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 DBAReceived on Wed Jul 13 2005 - 02:08:25 CDT