dbTalk Databases Forums  

Column into Row

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Column into Row in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
keeri
 
Posts: n/a

Default Column into Row - 09-03-2009 , 06:45 AM






Hi all,

I have a table like this ..

Name ID
-------- ----
A 1
B 2
C 3
D 4
E 5

If table is queried , I need like ..

Name A B C ..
ID 1 2 3 ..

Can anyone help me on this issue ?

Thanx,
Keerthi c

Reply With Quote
  #2  
Old   
ddf
 
Posts: n/a

Default Re: Column into Row - 09-03-2009 , 08:11 AM






On Sep 3, 6:45*am, keeri <ck.keer... (AT) gmail (DOT) com> wrote:
Quote:
Hi all,

I have a table like this ..

Name * * ID
-------- * * ----
A * * * * * *1
B * * * * * *2
C * * * * * *3
D * * * * * *4
E * * * * * *5

If table is queried , I need like ..

Name * * A * * B * * *C ..
ID * * * * * 1 * * 2 * * * 3 ..

Can anyone help me on this issue ?

Thanx,
Keerthi c
Knowing the version of Oracle you're using helps tremendously as the
options for providing that output vary with the age of the release.

Post your version to 4 or 5 numbers so someone can help you without
guessing.


David Fitzjarrell

Reply With Quote
  #3  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Column into Row - 09-03-2009 , 08:33 AM



On Sep 3, 7:45*am, keeri <ck.keer... (AT) gmail (DOT) com> wrote:
Quote:
Hi all,

I have a table like this ..

Name * * ID
-------- * * ----
A * * * * * *1
B * * * * * *2
C * * * * * *3
D * * * * * *4
E * * * * * *5

If table is queried , I need like ..

Name * * A * * B * * *C ..
ID * * * * * 1 * * 2 * * * 3 ..

Can anyone help me on this issue ?

Thanx,
Keerthi c
David is right. We need a little more information. Basically what
you probably want to do is called pivoting. There have been several
posts on the subject in the past. There are several approaches but
some require more recent versions of Oracle. Indeed 11g includes a
command to pivot data. You can seach the archives to find some
possible solutions.

HTH -- Mark D Powell --

Reply With Quote
  #4  
Old   
keeri
 
Posts: n/a

Default Re: Column into Row - 09-03-2009 , 08:36 AM



On Sep 3, 6:11*am, ddf <orat... (AT) msn (DOT) com> wrote:
Quote:
On Sep 3, 6:45*am, keeri <ck.keer... (AT) gmail (DOT) com> wrote:



Hi all,

I have a table like this ..

Name * * ID
-------- * * ----
A * * * * * *1
B * * * * * *2
C * * * * * *3
D * * * * * *4
E * * * * * *5

If table is queried , I need like ..

Name * * A * * B * * *C ..
ID * * * * * 1 * * 2 * * * 3 ..

Can anyone help me on this issue ?

Thanx,
Keerthi c

Knowing the version of Oracle you're using helps tremendously as the
options for providing that output vary with the age of the release.

Post *your version to 4 or 5 numbers so someone can help you without
guessing.

David Fitzjarrell

Hi David,

Oracle Database 10g Enterprise Edition Release 10.2.0.2.0

Can anyone help .. ?

Thanks,
Keerthi C

Reply With Quote
  #5  
Old   
ddf
 
Posts: n/a

Default Re: Column into Row - 09-03-2009 , 11:54 AM



On Sep 3, 8:36*am, keeri <ck.keer... (AT) gmail (DOT) com> wrote:
Quote:
On Sep 3, 6:11*am, ddf <orat... (AT) msn (DOT) com> wrote:





On Sep 3, 6:45*am, keeri <ck.keer... (AT) gmail (DOT) com> wrote:

Hi all,

I have a table like this ..

Name * * ID
-------- * * ----
A * * * * * *1
B * * * * * *2
C * * * * * *3
D * * * * * *4
E * * * * * *5

If table is queried , I need like ..

Name * * A * * B * * *C ..
ID * * * * * 1 * * 2 * * * 3 ..

Can anyone help me on this issue ?

Thanx,
Keerthi c

Knowing the version of Oracle you're using helps tremendously as the
options for providing that output vary with the age of the release.

Post *your version to 4 or 5 numbers so someone can help you without
guessing.

David Fitzjarrell

Hi David,

Oracle Database 10g Enterprise Edition Release 10.2.0.2.0

Can anyone help .. ?

Thanks,
Keerthi C- Hide quoted text -

- Show quoted text -
Read here:

http://asktom.oracle.com/pls/asktom/...D:419593546543


David Fitzjarrell

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.