Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 merging data from rows to column on duplicated ID

Author  Topic 

terrikwei
Starting Member

3 Posts

Posted - 2007-10-09 : 23:37:43
I am currently working to solve this problem that i am facing.
I just cant' get my desired solution to my problem.
As per below is the current db view.
emp_id skill level years remarks
2541 COMPUTER BAIK 1 <null>
2541 WORD PROCESSING BAIK 1 <null>
2541 EXCEL BAIK 1 <null>
2541 POWERPOINT BAIK 1 <null>

how do i get this repeated emp_id to have a view of..

emp_id skill level
2541 COMPUTER.wordprocessin,excel,powerpoint BAIK,baik,baik,baik
years remarks
1,1,1,1 <null>,<null>,<null>,<null>


i just can't seem to get this comin up.. please kind advise
thanks all!

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-10 : 02:29:44
Read about Cross-tab Reports in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

terrikwei
Starting Member

3 Posts

Posted - 2007-10-11 : 23:11:39
i tried the maxfunction.. seems to be givin the max result

SELECT COUNT(UV_EMPLOYEE_ID) AS Expr1, MAX(UV_SKILL) AS uv_skill, UV_EMPLOYEE_ID
FROM ORC_TB_SKILLS
GROUP BY UV_EMPLOYEE_ID

result:
3 WORD 64
3 WORD PROCESSING 579

which means that there are other two skills which is not shown.. i need to actually show all skill on duplicate

to uv_skill column...

sample output: 1234 excel,programming *assumingly 1234 is duplicated twice

pls advise.. thanks all
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2007-10-12 : 02:39:32
See if this helps
http://sqljunkies.com/WebLog/amachanic/archive/2004/11/10/5065.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -