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: Newbie needs help with dynamic column name in SQL

Re: Newbie needs help with dynamic column name in SQL

From: Peter J. Holzer <hjp-usenet_at_hjp.at>
Date: Mon, 18 Nov 2002 10:32:03 +0100
Message-ID: <slrnathcsj.p0i.hjp-usenet@teal.hjp.at>


On 2002-11-16 14:10, K. C. <the_ada_at_hotmail.com> wrote:
> Ok. I have a table called tableA:
>
> ID NUMBER
> Fld1 VARCHAR2(20)
> Val1 VARCHAR2(500)
>
> Where ID has values from 1 to 20, and Fld1 and Val1 could be anything.
>
> Now, I have another table tableB:
>
> Col1 VARCHAR2(20)
> Fld1 VARCHAR2(500)
> Col2 VARCHAR2(20)
> Fld2 VARCHAR2(500)
> .
> .
> .
> Col20 VARCHAR2(20)
> Fld20 VARCHAR2(500)
>
> Bascially I want to move the data from tableA to tableB. In tableA,
> records with ID = 1 would go into the Col1 and Fld1 columns in tableB,
> records with ID = 2 would go into the Col2 and Fld2 columns in tableB.

Does TableA have only 20 rows? Otherwise I don't see how you would determine which rows from TableA map to the same row in TableB.

Since you want the data in Excel: How about just using a Pivot table in Excel?

        hp

-- 
   _  | Peter J. Holzer    | Schlagfertigkeit ist das, was einem
|_|_) | Sysadmin WSR       | auf dem Nachhauseweg einfällt.
| |   | hjp_at_hjp.at         |    -- Lars 'Cebewee' Noschinski in dasr.
__/   | http://www.hjp.at/ |
Received on Mon Nov 18 2002 - 03:32:03 CST

Original text of this message

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