Home » SQL & PL/SQL » SQL & PL/SQL » How to convert column data into row
How to convert column data into row [message #243949] Mon, 11 June 2007 01:51 Go to next message
logintosekhar
Messages: 1
Registered: May 2007
Location: Hyderabad
Junior Member

Hi all,

i have following output with empno and deptno.

empno deptno
---------------------
1 10
2 10
3 20
4 20
5 20
7
8 20

now i want the output with empno separated by comma for each deptno in following way

empno deptno
---------------------------------------
1,2 10
3,4,5,8 20

please help me out

I want it in SQL query only not in a procedure

Thanks

Sekhar

[Updated on: Mon, 11 June 2007 01:55]

Report message to a moderator

Re: How to convert column data into row [message #243957 is a reply to message #243949] Mon, 11 June 2007 02:07 Go to previous messageGo to next message
Maaher
Messages: 7062
Registered: December 2001
Senior Member
Search the board for PIVOT, stragg, concat_all.

MHE
Re: How to convert column data into row [message #243961 is a reply to message #243949] Mon, 11 June 2007 02:10 Go to previous message
Michel Cadot
Messages: 64151
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
To add to Maarten's post.

Please always post your Oracle version (4 decimals).
Please read and followHow to format your posts and How to get a quick answer to your question: TIPS AND TRICKS

Regards
Michel
Previous Topic: Strange Error on Creating DB Table!!!
Next Topic: Logon trigger
Goto Forum:
  


Current Time: Fri Dec 09 19:42:16 CST 2016

Total time taken to generate the page: 0.08688 seconds