Home » SQL & PL/SQL » SQL & PL/SQL » Please help
Please help [message #388935] Thu, 26 February 2009 12:46 Go to next message
world.apps
Messages: 70
Registered: January 2007
Location: Hyderabad
Member
Hi

I have a requirement as below. My table contains data in the below format.


EMPNO ENAME JOB PLAN PLANROUND PLAN_Description 

100   ABC   HR  A    1 	       plan1
100   ABC   HR  A    1 	       plan2
100   ABC   HR  c    2         plan3
100   ABC   HR  d    3         plan4

200   DEF   MGR x    4	       plan7
200   DEF   MGR x    5	       plan8
200   DEF   MGR x    5	       plan9
200   DEF   MGR z    6	       plan10

300   MNO   CLK M    7         plan11



so for each employee how many different combinations are coming from plan,planround, plan_description columns,
I have to show in a single row for each employee.

for example Employee 100 has following values for

plan,planround, plan_descriptio columns.

A    1 	       plan1
A    1 	       plan2
c    2         plan3
d    3         plan4



so I have to show like A,1,plan1,plan2,c,2,plan3,d,3,plan4

Finally I have to show total report as below.

100,ABC,HR,A,1,plan1,plan2,c,2,plan3,d,3,plan4
200,DEF,MGR,x,4,plan7,5,plan8,plan9,z,6,plan10     
300,MNO,CLK,M,plan11


Could you please help me how to do this?

Thanks in advance
Re: Please help [message #388936 is a reply to message #388935] Thu, 26 February 2009 12:55 Go to previous message
Michel Cadot
Messages: 68718
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Search for pivot, wm_concat, stragg...

Next time choose a meaningful title.

Regards
Michel
Previous Topic: make field value as Header but dynamically
Next Topic: populate sequence
Goto Forum:
  


Current Time: Tue Dec 03 15:42:35 CST 2024