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 -> Multiple column sorting with a decode

Multiple column sorting with a decode

From: <voidhack_at_gmail.com>
Date: 24 Nov 2005 11:02:42 -0800
Message-ID: <1132858962.352135.52160@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. Received on Thu Nov 24 2005 - 13:02:42 CST

Original text of this message

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