Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Variable Order By clause
Thanks Jan, this works fine.
Any idea why there is a restriction on using variables in the ORDER BY clause?
Jan H Malmberg wrote:
>
> Try something like
>
> SELECT
> seq_no,
> issue_type
> FROM known_issues
> WHERE system_id = 99
> ORDER BY DECODE(ord1,1,seq_no,issue_type),
> DECODE(ord2,2,issue_type,seq_no);
>
> It can of course only handle predefined situations but it avoids dynamic
> sql.
>
Received on Wed Aug 11 1999 - 09:05:23 CDT
![]() |
![]() |