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: Help me out on tricky SQL!

Re: Help me out on tricky SQL!

From: Thomas Schwickert <schwickert_at_yahoo.com>
Date: Tue, 11 Sep 2001 13:23:38 +0000 (UTC)
Message-ID: <7539b2f7374ec4115241f119b4518f64.20305@mygate.mailgate.org>


Hi,

select max(a),max(b),max(c),max(d)
from
(select

 decode(rownum,1,a,null) a

,decode(rownum,2,a,null) b
,decode(rownum,3,a,null) c
,decode(rownum,4,a,null) d

from t1)
union all
select max(to_char(a)),max(to_char(b)),max(to_char(c)),max(to_char(d)) from
(select
 decode(rownum,1,b,null) a

,decode(rownum,2,b,null) b
,decode(rownum,3,b,null) c
,decode(rownum,4,b,null) d

from t1)

ugly, but works ...

Hth
 Thomas

-- 
Posted from  [212.20.131.226] 
via Mailgate.ORG Server - http://www.Mailgate.ORG
Received on Tue Sep 11 2001 - 08:23:38 CDT

Original text of this message

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