Re: Transposing Table Columns to Table Rows
Date: 1995/05/17
Message-ID: <james.lawrence.30.000E5BC5_at_EPAMAIL.EPA.GOV>#1/1
In article <3onu98$as4_at_News1.mcs.com> Michael Janiak <quakerdw_at_mcs.com> writes:
>From: Michael Janiak <quakerdw_at_mcs.com>
>Subject: Transposing Table Columns to Table Rows
>Date: 9 May 1995 14:30:00 GMT
>I have a Powerbuilder application that needs to read an Oracle table
>and insert the values in that table's columns into another table as
>rows. For example: We select the values in col1, col2, and col3 from
>table A. These values need to be inserted into col1 of rows r1,r2,
>and r3 of table B.
>At the present time the application programmer is performing separate
>insert subselects. There can be up to 30 columns selected.
>Does anyone know of a better way of doing this?
>Thank you.
How about a union?
insert into tableb (col1)
select col1 from tablea
union
select col2 from tablea
select col3 from tablea;
Received on Wed May 17 1995 - 00:00:00 CEST