SQL question - crosstab in oracle

2003-07-08 Thread Stephen . HODGKINSON


Hi

I have a table with the following structure.

 CHECK_DATE DATE
 PHYRDS NUMBER(20)
 PHYWRTSNUMBER(20)
 PHYBLKRD   NUMBER(20)
 PHYBLKWRT  NUMBER(20)
 FILE#   NUMBER
 FILE_NAME  VARCHAR2(120)

This records the IO on the different datafiles every 3 minutes.

I want to run a report on this table but I want the output to display on
file# as a heading.Similar to iostat on UNIX.

So my output   might be:



Check DATE   FIle1  File2
 File3 etc...
   PHYRDS   PHYWRTS   PHYRDS   PHYWRTS

11:14:341270820218 14
11:18:261303821118 14
11:33:441429024318 14
11:40:451500824518 14
11:45:371545924918 14
11:48:381577625018 14
11:51:371586425118 14
11:54:371602925418 14
11:57:391621025418 14
12:00:401631125418 14
12:03:401643925618 14


I could do this as a bit of plsq but  Is it possible to generate this
report with one bit of sql. (views,inline views, decodes.  etc)

thanks stephen



**
This email contains information which is confidential. It is for the 
exclusive use of the addressee. If you are not an addressee please 
contact us immediately on 01737 275500. Please note that any 
distribution, copying or use of this communication or its contents is 
prohibited.

This footnote also confirms that this email message and all associated
attachments have been swept by Network Associates VirusScan for the 
presence of computer viruses.
**

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

Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).


Re: SQL question - crosstab in oracle

2003-07-08 Thread Jay Wade
There are several ways to handle this.
If you do a search for pivot on AskTom you will get a good sampling of them.


From: [EMAIL PROTECTED]
Reply-To: [EMAIL PROTECTED]
To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED]
Subject: SQL question - crosstab in oracle
Date: Tue, 08 Jul 2003 06:34:24 -0800


Hi

I have a table with the following structure.

 CHECK_DATE DATE
 PHYRDS NUMBER(20)
 PHYWRTSNUMBER(20)
 PHYBLKRD   NUMBER(20)
 PHYBLKWRT  NUMBER(20)
 FILE#   NUMBER
 FILE_NAME  VARCHAR2(120)
This records the IO on the different datafiles every 3 minutes.

I want to run a report on this table but I want the output to display on
file# as a heading.Similar to iostat on UNIX.
So my output   might be:



Check DATE   FIle1  File2
 File3 etc...
   PHYRDS   PHYWRTS   PHYRDS   PHYWRTS
11:14:341270820218 14
11:18:261303821118 14
11:33:441429024318 14
11:40:451500824518 14
11:45:371545924918 14
11:48:381577625018 14
11:51:371586425118 14
11:54:371602925418 14
11:57:391621025418 14
12:00:401631125418 14
12:03:401643925618 14
I could do this as a bit of plsq but  Is it possible to generate this
report with one bit of sql. (views,inline views, decodes.  etc)
thanks stephen



**
This email contains information which is confidential. It is for the
exclusive use of the addressee. If you are not an addressee please
contact us immediately on 01737 275500. Please note that any
distribution, copying or use of this communication or its contents is
prohibited.
This footnote also confirms that this email message and all associated
attachments have been swept by Network Associates VirusScan for the
presence of computer viruses.
**
--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author:
  INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).
_
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail

--
Please see the official ORACLE-L FAQ: http://www.orafaq.net
--
Author: Jay Wade
 INET: [EMAIL PROTECTED]
Fat City Network Services-- 858-538-5051 http://www.fatcity.com
San Diego, California-- Mailing list and web hosting services
-
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).