Re: display table row into column

From: <johnbhurley_at_sbcglobal.net>
Date: Thu, 26 Feb 2009 06:05:50 -0800 (PST)
Message-ID: <a0242919-4f8e-4654-930f-afaf203e6ffe_at_q9g2000yqc.googlegroups.com>



On Feb 26, 7:48 am, shweta.kapar..._at_googlemail.com wrote:
> Hi All
>
> I have :
>
> SQL> create table t1( col1 varchar2(10), col2 varchar2(10),col3
> varchar2(10));
>
> Table created.
>
> SQL>
>
> SQL>  insert into t1(col1,col2,col3) values ('A','B','C');
>
> 1 row created.
>
> SQL> insert into t1(col1,col2,col3) values ('D','E','F');
>
> 1 row created.
>
> SQL>  insert into t1(col1,col2,col3) values ('G','H','I');
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select * from t1;
>
> COL1       COL2       COL3
> ---------- ---------- ----------
> A          B          C
> D          E          F
> G          H          I
>
> i want to write select query which should give me the output:
> as
>
> col1    col2    col3
> ----     ------    ------
> B       E        H
>
> Regards
>
> Shweta

Did you look at Tom Kyte's site asktom.oracle.com?

Do a little searching around there lots of examples already out there. Received on Thu Feb 26 2009 - 08:05:50 CST

Original text of this message