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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: CROSS TAB QUERY

RE: CROSS TAB QUERY

From: Aponte, Tony <AponteT_at_hsn.net>
Date: Thu, 29 Nov 2001 07:39:54 -0800
Message-ID: <F001.003D06F1.20011129064530@fatcity.com>

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:moyam_at_mtn.co.ug]

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: moyam_at_mtn.co.ug


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).
Received on Thu Nov 29 2001 - 09:39:54 CST

Original text of this message

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