Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Multiple column sorting with a decode
<voidhack_at_gmail.com> a écrit dans le message de news: 1132858962.352135.52160_at_g49g2000cwa.googlegroups.com...
| Hello,
|
| I am trying to sort on multiple columns using a parameter that I
| specify as the sort order.
| For example,
| ...
| ORDER BY DECODE(:param,1, '1, 3', 2, '1,4')
|
| While the order by works using any combination of columns, by using the
| decode, it does not.
| A single colomn ordering (DECODE(:param,1,'1',2',2)) works tough.
|
| Any ideas ?
|
| (the goal is to order trough multiple columns using a parameter
| specfying the order type.
|
col order noprint new_value order
select DECODE(:param,1, '1, 3', 2, '1,4') order from dual;
then
...order by &order
Regards
Michel Cadot
Received on Thu Nov 24 2005 - 13:12:14 CST