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: order by (asc and desc)

Re: order by (asc and desc)

From: Brian Peasland <peasland_at_edcmail.cr.usgs.gov>
Date: Fri, 5 Nov 1999 13:46:20 GMT
Message-ID: <3822DFAC.CFD9609B@edcmail.cr.usgs.gov>


Try:

 BEGIN
   IF flag = 1 THEN
     SELECT a FROM abc ORDER BY a ASC;
   ELSE
     SELECT a FROM abc ORDER BY a DESC;    END IF;
 END; HTH,
Brian

Eric Luu wrote:
>
> Hi All,
>
> Is there a way of choosing which ordering to use
> (ascend or descend) depending on a flag.
>
> like:
>
> select a
> from abc
> order by a decode(flag, 1, asc, 2, des)
>
> I can use dynimic query, but too much.
> Any help would be appreciated.
>
> you can email me at
> ericluu_at_hotmail.com
> Thanks
Received on Fri Nov 05 1999 - 07:46:20 CST

Original text of this message

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