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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Denormalizing a database table

Re: Denormalizing a database table

From: DA Morgan <damorgan_at_psoug.org>
Date: Wed, 09 Aug 2006 12:58:36 -0700
Message-ID: <1155153517.528965@bubbleator.drizzle.com>


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.org
Received on Wed Aug 09 2006 - 14:58:36 CDT

Original text of this message

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