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
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