Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Denormalizing a database table
alkkmrz2004_at_yahoo.com wrote:
> Folks,
>
> Any help with creating a SP that denormalizes the below table to the
> desired output will be appreciated.
>
>
> Current Input Table Structure:
>
>
> SNum KeyName KeyVal value
> 1 SCM1 name DFW
> 1 SCM1 OVal 200
> 1 SCM1 OSum 500
> 2 SCM2 name ORL
> 2 SCM2 OVal 100
> 2 SCM2 OSum 200
> 3 SCM1 name DFW
> 3 SCM1 OVal 100
> 3 SCM1 OSum 100
>
>
> Desired O/p in a secondary temp table
>
>
> DFW 200 500
> ORL 100 200
> DFW 100 100
>
>
> Rgds
> Alk
This has nothing to do with denormalizing anything. It is a simple case of crosstabulation. Do it with DECODE or CASE.
Demos in Morgan's Library at www.psoug.org under DECODE.
-- Daniel A. Morgan University of Washington damorgan_at_x.washington.edu (replace x with u to respond) Puget Sound Oracle Users Group www.psoug.orgReceived on Wed Aug 09 2006 - 14:58:36 CDT
![]() |
![]() |