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

Home -> Community -> Usenet -> c.d.o.server -> Re: dynamic view/crosstab query question

Re: dynamic view/crosstab query question

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 12 Mar 2004 14:57:24 -0800
Message-ID: <1079132249.286880@yasure>


Mike Stenzler wrote:

> Hi.
>
> I'm wondering if there's a way to effectively apply a "crosstab" view upon a
> table.
>
> I have a table with column such:
>
> date name type value
> 1/1/03 A E 123
> 1/1/03 A F 235
> 1/1/03 B E 999
> 1/1/03 C E 888
> 1/1/03 C F 777
> 1/2/03 A E 234
> 1/2/03 A F 237
> 1/2/03 B E 991
> 1/2/03 C E 889
> 1/2/03 C F 766
> .
> .
> .
> and so on...
>
> I'd like to create a view or query that would allow me to look at this data
> in the fashion below:
>
> date type name name name...
> A B C ...
> 1/1/03 E 123 999 888 ...
> 1/2/03 E 234 991 889 ...
> 1/3/03 E ... ... ... ...
>
> 1/1/03 F 235 777 ...
> 1/2/03 F 234 991 766 ...
> 1/3/03 F ... ... ... ...
>
> Is it possible to create a view on a table that extends "sideways"
> dynamically as names are added? And how would one transpose the data
> presented in the table into the "crosstabbed" view of that data?
>
> Thanks in advance for any ideas and help.
>
> Mike

With decode: See demo at: http://www.psoug.org/reference/library.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Mar 12 2004 - 16:57:24 CST

Original text of this message

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