Re: display table row into column

From: <shweta.kaparwan_at_googlemail.com>
Date: Thu, 26 Feb 2009 08:53:37 -0800 (PST)
Message-ID: <0edf77aa-953b-404f-abff-9d4b6249fea7_at_c36g2000yqn.googlegroups.com>



On Feb 26, 3:10 pm, gar..._at_jamms.org wrote:
> On 26 Feb, 12:48, 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
>
> This is a very popular question. Search the group, or asktom, for
> "pivot query".
>
> HTH
>
> -g- Hide quoted text -
>
> - Show quoted text -

Thanks all. Received on Thu Feb 26 2009 - 10:53:37 CST

Original text of this message