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: Thierry Poels <Thierry.Poels_at_vab.be>
Date: Fri, 5 Nov 1999 13:26:16 +0100
Message-ID: <7vume1$9sd$1@news0.skynet.be>


Hi Eric,

there's a possible workaround :

column TMPCOL new_value MYSORT

select decode(FLAG, 1, 'asc', 2, 'desc') TMPCOL from dual;

select A from ABC order by A &MYSORT;

good luck,
Thierry Poels
Oracle DBA & HP-UX Sysadmin

Eric Luu <ericluu_at_hotmail.com> wrote in message news:382202b9$0$206_at_nntp1.ba.best.com...
> 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 - 06:26:16 CST

Original text of this message

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