| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Newbie needs help with dynamic column name in SQL
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
![]() |
![]() |