Path: news.cambrium.nl!textnews.cambrium.nl!feeder3.cambrium.nl!feed.tweaknews.nl!postnews.google.com!l33g2000pri.googlegroups.com!not-for-mail
From: srinivasarao22@gmail.com
Newsgroups: comp.databases.oracle.server
Subject: Re: display table row into column
Date: Mon, 2 Mar 2009 23:09:31 -0800 (PST)
Organization: http://groups.google.com
Lines: 54
Message-ID: <2f621a72-af0f-49ac-bde3-d38c7b579c2a@l33g2000pri.googlegroups.com>
References: <1ae25a52-a639-4729-8c17-8582ae44330f@e24g2000vbe.googlegroups.com>
NNTP-Posting-Host: 219.64.121.136
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1236064171 17815 127.0.0.1 (3 Mar 2009 07:09:31 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 3 Mar 2009 07:09:31 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: l33g2000pri.googlegroups.com; posting-host=219.64.121.136; 
 posting-account=zSoFBgoAAAC88Rbm7c2oiMpmXn5xjNYd
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.6) 
 Gecko/2009011913 Firefox/3.0.6,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 localhost:3128 (squid/2.6.STABLE18)
Xref:  news.cambrium.nl

On Feb 26, 5:48=A0pm, shweta.kapar...@googlemail.com wrote:
> Hi All
>
> I have :
>
> SQL> create table t1( col1 varchar2(10), col2 varchar2(10),col3
> varchar2(10));
>
> Table created.
>
> SQL>
>
> SQL> =A0insert 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> =A0insert into t1(col1,col2,col3) values ('G','H','I');
>
> 1 row created.
>
> SQL> commit;
>
> Commit complete.
>
> SQL> select * from t1;
>
> COL1 =A0 =A0 =A0 COL2 =A0 =A0 =A0 COL3
> ---------- ---------- ----------
> A =A0 =A0 =A0 =A0 =A0B =A0 =A0 =A0 =A0 =A0C
> D =A0 =A0 =A0 =A0 =A0E =A0 =A0 =A0 =A0 =A0F
> G =A0 =A0 =A0 =A0 =A0H =A0 =A0 =A0 =A0 =A0I
>
> i want to write select query which should give me the output:
> as
>
> col1 =A0 =A0col2 =A0 =A0col3
> ---- =A0 =A0 ------ =A0 =A0------
> B =A0 =A0 =A0 E =A0 =A0 =A0 =A0H
>
> Regards
>
> Shweta



 SELECT  (SELECT col2 FROM t1 WHERE col1=3D'A') col1,(SELECT col2 FROM
t1 WHERE col1=3D'D') col2,(SELECT col2 FROM t1 WHERE col1=3D'G') col3 FROM
t1
WHERE  ROWNUM<2

