Hello,
I have made a select statement from a database and wonder if there is any possibillity to have two different 'order by'. If the first one doesn´t fit, the second one will be used.
Someting like: order by ($sortBy $order or 1)
If I truely understand your question, simply use a DECODE statement to differentiate between columns or values to sort on. Just be sure that the options to sort on are of the same type. That is, Column2 and Column3 MUST be of the same datatype. However, Column1 need not be of the same datatype. So here Column1 is a VARCHAR2, but Column2 and Column3 can be numeric.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.