June 17, 2008 at 5:16 pm
This is probably very simple, but I am still learning and haven't been able to figure this out.
I have a table that lists employee skills:
employee1 skill1
employee1 skill2
employee1 skill3
employee2 skill2
employee3 skill1
employee3 skill5
I need to create a view that shows all the skills for each employee on the same row, either concatenated:
employee1 skill1, skill2, skill3
employee2 skill2
employee3 skill1, skill5
or in seperate columns
employee1 skill1 skill2 skill3
employee2 skill2 null null
employee3 skill1 skill5 null
One of the challenges is that an employee may have anywhere from 0 to ten skills.
Anyone have an easy solution?
June 17, 2008 at 7:01 pm
david (6/17/2008)
Anyone have an easy solution?
Yes I do... please see the following... tells you not only how to do it, but how to do it right... 😀
http://www.sqlservercentral.com/articles/Test+Data/61572/
--Jeff Moden
Change is inevitable... Change for the better is not.
June 18, 2008 at 4:01 pm
Thank you Jeff,
This looks like it will do the trick.
I will be working on this tomorrow.
June 18, 2008 at 5:46 pm
You bet... thanks for the feedback... let us know if you have problems with the implementation.
--Jeff Moden
Change is inevitable... Change for the better is not.
June 19, 2008 at 5:22 pm
Got my project done! While the code that you provided is over my current comprehensive level, I was able to incorperate it into my query and it works beautifully. It always amazes me how there is such a huge range of efficiency in code.... always seems like the most efficient are the hardest to comprehend. Thanks a million,
David
June 20, 2008 at 5:54 pm
Very cool... thanks for the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply