Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Transpose a SQL query
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
![]() |
![]() |