Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: how to creat a Pivot Table with Oracle8
(This is why I continue to use Access)
You must first obtain a list of all of the subordinate column names.
Then you must (manually) construct the crosstab yourself using the Oracle function DECODE
Assume table T:
F1 number
F2 varchar2(..)
(All) Possible values values for F2 are V1, V2, V3, ... Vn
select
F1,
count(*) total,
sum(decode(F2,V1,1,0)) V1, sum(decode(F2,V1,1,0)) V2, sum(decode(F2,V1,1,0)) V3,
This produces the ouput:
F1 Total V1 V2 V3 ... Vn ---- ------ --- --- --- --- ---
xx xx xx xx xx xx xx xx xx xx xx xxetc.
(bites, doesn't it?)
Michaela Weber <weberm68_at_hotmail.com> wrote in message
news:7v9bvq$8lm$1_at_news.imp.ch...
> Hello there...
>
> Does anybody has a idea how to creat an PivotTabel with Oracle8
>
> There are two linked table 1:n . In Access it works very well (with the
> wizzard)...but I have no idea how I can do it in ORACLE
>
> thanks
>
> Michaela
>
>
>
Received on Fri Oct 29 1999 - 13:08:06 CDT