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: Transpose a SQL query

Re: Transpose a SQL query

From: The Ghost <The_at_Ghost.com>
Date: Thu, 22 Mar 2001 04:26:25 GMT
Message-ID: <R9fu6.102285$p66.29290243@news3.rdc1.on.home.com>

select field1
from tab
union all
select field2
union all
from tab

...
..
.
.
.


<vikasa_at_despammed.com> wrote in message
news:0dpibtsm4ltk78t5qfsj3lab435c99i4hs_at_4ax.com...
> How can I transpose a SQL query? i.e. convert rows to columns and
> columns to rows?
>
> Lets start off with the simple case of, say, 1 row and 5 columns. How
> do I get 5 rows and 1 column from this?
>
> Is there some generic technique for this (read: clever SQL), some
> Oracle 8i features, or does one need to write PL/SQL?
>
> Thanks...
Received on Wed Mar 21 2001 - 22:26:25 CST

Original text of this message

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