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: Sybrand Bakker <gooiditweg_at_sybrandb.demon.nl>
Date: Sat, 13 Mar 2004 08:32:01 +0100
Message-ID: <c7e550h2e833dva83ds117661530m2qabb@4ax.com>


On Fri, 12 Mar 2004 14:45:17 -0500, "Mike Stenzler" <mstenzler_at_ssaris.com> 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
>
>

Search for 'PIVOT' on http://asktom.oracle.com Has several articles exactly addressing your questions, with scott/tiger based examples

--
Sybrand Bakker, Senior Oracle DBA
Received on Sat Mar 13 2004 - 01:32:01 CST

Original text of this message

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