Possible Duplicate:
Concatenate many rows into a single text string?
I have a table called SkillSets
with a SkillID
field and a SkillSetID
field. Let's says I have records in this table as in:
SkillID SkillSetID
------- ----------
750 2
750 4
750 5
751 3
751 4
751 6
I need a query that produces the following:
SkillID SkillSetIDs
------- ----------
750 2,4,5
751 3,4,6
Seems to me I remember seeing this using some sort of xml clause but cant find anything about it, and just don't know how to get it done without using a cursor or while loop. Can you help?