Home » SQL & PL/SQL » SQL & PL/SQL » column wise Data after wmsys.wm_concat (oracle 10g,XP)
column wise Data after wmsys.wm_concat [message #448712] Wed, 24 March 2010 23:31 Go to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member

select  deptno,wmsys.wm_concat(ename) ename from scott.emp group by deptno


DEPTNO   ENAME
10       CLARK,KING,MILLER
20       SMITH,FORD,ADAMS,SCOTT,JONES
30       ALLEN,BLAKE,MARTIN,TURNER,JAMES,WARD


the output i want is 


DEPTNO      ENAME  ENAME    ENAME    ENAME   ENAME   ENAME

10         CLARK    KING    MILLER   
20         SMITH    FORD    ADAMS    SCOTT   JONES
30         ALLEN    BLAKE   MARTIN  TURNER   JAMES    WARD


Please guide me .Thanks in advance
Re: column wise Data after wmsys.wm_concat [message #448713 is a reply to message #448712] Wed, 24 March 2010 23:34 Go to previous messageGo to next message
BlackSwan
Messages: 24905
Registered: January 2009
Senior Member
What about name like MISSISSIPPI or longer?
Re: column wise Data after wmsys.wm_concat [message #448715 is a reply to message #448712] Wed, 24 March 2010 23:39 Go to previous messageGo to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member

Yes some times there may occur longer data
Re: column wise Data after wmsys.wm_concat [message #448720 is a reply to message #448712] Thu, 25 March 2010 00:23 Go to previous messageGo to next message
Michel Cadot
Messages: 63804
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Do you want to get the result from EMP table or from a table that looks like your first output?

Regards
Michel

[Updated on: Thu, 25 March 2010 00:23]

Report message to a moderator

Re: column wise Data after wmsys.wm_concat [message #448722 is a reply to message #448720] Thu, 25 March 2010 00:34 Go to previous messageGo to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member

Sir I want to get the result from a table that looks like your first output
Re: column wise Data after wmsys.wm_concat [message #448723 is a reply to message #448722] Thu, 25 March 2010 00:37 Go to previous messageGo to next message
Michel Cadot
Messages: 63804
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Help you with the following topics:
http://www.orafaq.com/forum/m/445772/102589/?#msg_445772
http://www.orafaq.com/forum/m/441765/102589/?#msg_441765
http://www.orafaq.com/forum/m/255052/102589/?#msg_255052


Regards
Michel
Tell me and I'll forget; show me and I may remember; involve me and I'll understand

[Updated on: Thu, 25 March 2010 00:41]

Report message to a moderator

Re: column wise Data after wmsys.wm_concat [message #448724 is a reply to message #448712] Thu, 25 March 2010 00:50 Go to previous messageGo to next message
rakeshramm
Messages: 175
Registered: September 2006
Location: Oracle4u.com
Senior Member

Sorry, I want to get the result from a table that looks like second output
Re: column wise Data after wmsys.wm_concat [message #448744 is a reply to message #448724] Thu, 25 March 2010 01:44 Go to previous message
Michel Cadot
Messages: 63804
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
What you have and want is unclear. You are starting from what to go to what?

Post a working Test case: create table and insert statements along with the result you want with these data then we will work with your table and data.


Regards
Michel
Tell me and I'll forget; show me and I may remember; involve me and I'll understand

[Updated on: Thu, 25 March 2010 01:45]

Report message to a moderator

Previous Topic: RESTRICT_REFERENCE
Next Topic: consecutive dates
Goto Forum:
  


Current Time: Mon Sep 26 14:33:54 CDT 2016

Total time taken to generate the page: 0.11323 seconds