Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> sort by decode in union all

sort by decode in union all

From: Peter Chang <jchang_at_flash.net>
Date: 2000/05/28
Message-ID: <9ZbY4.11$CH4.1905@news.flash.net>#1/1

Hi,
I have a query like select a.empno empno,

                                           a.status status,
                                           a.sallary sal
                                    from table_a  a
                                  union
                                 select b.empno empno,
                                            b.status   status,
                                            b.sallary    sal
                                   from  table_b  b
                           order by 2,1,3         -----------  I know do
that
                 But how do you do order  by (decode
&p,1,'status',2,empno,sallary)

Thanks you all Received on Sun May 28 2000 - 00:00:00 CDT

Original text of this message

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