Title: RE: CROSS TAB QUERY

What Oracle version?  Also, is the requirement for pure SQL or can there be some PL/SQL?

Tony Aponte

-----Original Message-----
From: Moses Ngati Moya [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, November 28, 2001 3:15 AM
To: Multiple recipients of list ORACLE-L
Subject: CROSS TAB QUERY


Hi Gurus,

I have a table Monthly_Stats as below:

MONTH           VARCHAR2(20),
ERLANG  NUMBER(7,2)
CONG            NUMBER(5,2)
.
.
CSETUP  NUMBER(5,2)

A record is inserted in this table every end of month.

I would like to write an SQL query to produce output below:
                       
                                MONTH
                JAN     FEB     MAR     APR     MAY     .       .       .
DEC
               
ERLANG  777     999     98      66      87                              999
CONG            9       6       3       4       2
4
CSETUP
.
.
.

I do not know the number of months in advance, i.e. if the table has 3 months
(JAN, FEB, MAR), these are the only months I need in the report.


Any suggestions??


Moses Moya Ngati
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Moses Ngati Moya
  INET: [EMAIL PROTECTED]

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: [EMAIL PROTECTED] (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).

Reply via email to