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

Home -> Community -> Usenet -> c.d.o.tools -> Selecting rows as columns

Selecting rows as columns

From: <mbraund_at_my-deja.com>
Date: Fri, 01 Sep 2000 15:43:28 GMT
Message-ID: <8ooiqp$pq7$1@nnrp1.deja.com>

Hi,

I'm trying to generate a select statement. I'll use the following table as an example:

Date Date
Time_Band Varchar2(7)
Calls Number

Time_Band can take three values (Peak, OffPeak, Weekend). I want to query the table and return one row giving the number of calls for each timeband.

eg. :

    Peak OffPeak Weekend


      2 3 0

I'm sure it should be easy - but I can't figure it out. I would like to do it in one (relatively) simple query if possible.

Thanks for your help.

Mark

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Sep 01 2000 - 10:43:28 CDT

Original text of this message

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