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: cross-table in oracle7.3

Re: cross-table in oracle7.3

From: Jack Ploeg <jploeg_at_wxs.nl>
Date: 1998/01/09
Message-ID: <34b5fdec.5043829@news.wxs.nl>#1/1

Martin,

Try:

select t1.date_time,
       t1.value values_id_1,
       t2.value values_id_2,
       t3.value values_id_3
from table1 t1,
     table1 t2,
     table1 t3
where t1.id = 1
and   t2.id = 2
and   t3.id = 3

and t1.date_time = t2.date_time
and t1.date_time = t3.date_time

Jack
"Ing. Martin Gamperl" <mgampi_at_ibm.net> wrote:

> I´d like to generate a crosstable which looks like this:
>
>date/time | values of ID=1 values of ID=2 values of ID=3
>--------------------------------------------------------------------
>12.12 13:44 | 3.0 4.0 2.3
>12.12 13:54 | 3.2 5.2 2.1
>12.12 14:04 | 2.9 5.1 2.1
>
>How can I generate this crosstable with SQL for Oracle 7.3.
>Is there a similar Command like TRANSFORM in Access 97?
>
>I obtain these values from one table:
>
>ID date/time Value
>-------------------------------------
>1 12.12 13:44 3.0
>2 12.12 13:44 4.0
>3 12.12 13:44 2.3
>1 12.12 13:54 3.2
>2 12.12 13:54 5.2
>3 12.12 13:54 2.1
>1 12.12 14:04 2.9
>2 12.12 14:04 5.1
>3 12.12 14:04 2.1
>
>Please answer via email
>
>Thanxs in advance
>
>Martin
>
>---------------------------------------------------
>* Ing. Martin Gamperl
>* MGS Softwareentwicklung
>* Klosterwiesgasse 31/IV
>* A-8010 GRAZ
>* Tel. : +43-316-83 58 26
>* Fax : +43-316-83 58 26
>* Mobil : +43-664-40 03 032
>* EMail : mgampi_at_ibm.net
>---------------------------------------------------
>
>
>
Received on Fri Jan 09 1998 - 00:00:00 CST

Original text of this message

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