Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: reverse pivoting
On Mon, 11 Mar 2002 15:39:54 -0800, "Kenny Yu" <kyu_at_biodiscovery.com> wrote:
>Is there systematic approaches in data warehousing to do the following
>
>converting table Pivot (customer, product, amount) -- many rows per
>customer
>
>into table RPivot (customer, prod1Amt, prod2Amt, ... prodnAmt) -- one row
>per customer
>
>the columns in the RPivot table are the unique values in the Pivot.product
>column.
>
>I am interested in a pure SQL way.
>
>Thanks.
>
You can use the decode function or the Case function in SQL...
A Pure SQL Way...
HTH
[Additions and Corrections Always Welcome.]
Best Regards,
Ganesh R
Received on Tue Mar 12 2002 - 02:35:48 CST