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: 26766
Registered: January 2009
Location: SoCal
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: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
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: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
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: 68733
Registered: March 2007
Location: Saint-Maur, France, https...
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: Fri Feb 07 21:48:08 CST 2025