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 -> Re: Variable Order By clause

Re: Variable Order By clause

From: David Gilbert <nepherim42_at_hotmail.com>
Date: Wed, 11 Aug 1999 10:05:23 -0400
Message-ID: <37B18323.D8904CA4@hotmail.com>


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

Original text of this message

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