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 wrote:
: I see. But then I would have no reports.
: I asume that there is no way to sort on multiple columns using a decode
: in a single SQL query then ?
It is almost always wrong to assume there is "no way" to do something.
: Is there a reason why the string returned by the decode is not
: interpreted correctly as two consecutive column parameters ?
It is you who is interpreting the expression incorrectly.
The decode returns a value at run time, but the column numbers are part of the syntax of the expression which is determined during compilation.
Basically you are misunderstanding what it means for those strings to be "interpreted correctly".
Anyway, see my other answer for one possible solution. Received on Thu Nov 24 2005 - 13:29:30 CST