Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> Re: How to write a sql query
This might be a possible solution assuming that you only have three rows and
three columns in the matrix :
select distinct a.a1, b3, b4, b5
from (select a1, b2 b3
from testtb) a, (select a1, b2 b4 from testtb) b, (select a1, b2 b5 from testtb) c where a.a1 = b.a1 and b.a1 = c.a1 and a.b3 < b.b4 and b.b4 < c.b5 and c.b5 > a.b3 and a.rowid != b.rowid and b.rowid != c.rowid and a.rowid != c.rowid
Tell me what you think about it ...
Allan.
----- Original Message -----
From: "Ajay K" <ajay_at_tems.com>
To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
Sent: Wednesday, November 22, 2000 5:31 PM
Subject: Re: How to write a sql query
> use decode ...
>
> ----- Original Message -----
> To: "Multiple recipients of list ORACLE-L" <ORACLE-L_at_fatcity.com>
> Sent: Wednesday, November 22, 2000 5:56 AM
>
>
> > Hi All
> >
> > How to write a sql query to print in the matrix report.
> > Eg . Test table .
> > a1 b1
> > 1 2.3
> > 1 3.5
> > 1 7.0
> > 2 1.7
> > 2 2.6
> > 2 2.9
> > 3 1.3
> > 3 2.9
> > 3 3.0
> >
> >
> > I need the output ,should be
> >
> > 1 2.3 3.5 7.0
> > 2 1.7. 2.6 2.9
> > 3 1.3 2.9 3.0
> >
> >
> > Please , Any one suggest me how to write a sql query for this.
> >
> >
> > Thanks & Regards
> > Magesh
> >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: magesh
> > INET: magesh_at_garoo.ne.jp
> >
> > Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> > San Diego, California -- Public Internet access / Mailing Lists
> > --------------------------------------------------------------------
> > To REMOVE yourself from this mailing list, send an E-Mail message
> > to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> > the message BODY, include a line containing: UNSUB ORACLE-L
> > (or the name of mailing list you want to be removed from). You may
> > also send the HELP command for other information (like subscribing).
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Ajay K
> INET: ajay_at_tems.com
>
> Fat City Network Services -- (858) 538-5051 FAX: (858) 538-5051
> San Diego, California -- Public Internet access / Mailing Lists
> --------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from). You may
Received on Wed Nov 22 2000 - 16:29:00 CST