Re: How to transpose?

From: Dr. Richard G. Ramirez <ou79138_at_deere.com>
Date: 1996/05/22
Message-ID: <Drt8ox.9on_at_deere.com>#1/1


I had the same problem and found no easy solution.

Here are my solutions:

  • build a view using DECODE or a table using PL/SQL
  • use MS Excel

Richard

hsing_at_ix.netcom.com (Peter Y. Hsing) wrote:
>Mason:
>
>This is interesting. Do you mind if I ask why you need to transpose?
>How is the transposed data going to be used, ie, do you really need to
>transpose the data?
>
>Have you tried using an array and then stepping through it row by row,
>then column by column, i.e. starting from the first record, read the
>data into a *column* of an array or temporary table via double loop
>(fill in array columns from the table, row by row). Maybe this can
>probably be done via PL/SQL; otherwise, it can be easily handled by
>SQR (a populur product by MITI/Sybase).
>
>-Peter Hsing
>
>
>
>On Fri, 17 May 1996 12:37:44 -0700, Mason Liu
><lium_at_dspmp001.research.allied.com> wrote:
>
>>Say I retrieve 8 rows x 95 columns of data. What is the most efficient
>>way to transpose it so that it becomes 95 rows x 8 columns.
>>
>>I can accept a single data block with tab separated data items and
>>carriage return+new line separated rows.
>>
>>Right now, I built a big concatenation SQL to accomplish this and I
>>wonder, perhaps, there is a better way. For example, Oracle might have a
>>a undocumented TRANSPOSE function for me to use, althought Oracle support
>>said none.
>>
>>Thanks in advance.
>>
>>Mason Liu
>>Object Labs, Inc.
>
>
Received on Wed May 22 1996 - 00:00:00 CEST

Original text of this message