views:

83

answers:

0

Possible Duplicate:
How do I Create a Comma-Separated List using a SQL Query?

ItemName  | DepartmentId   
--------------------- 
Item1     | 21      
Item1     | 13
Item1     | 9
Item1     | 36
Item2     | 4
Item2     | 9
Item2     | 44

I need to display all the department Id's that require a particular Item using SQL Queries. The above resultset has to be displayed as follows:

ItemName  | DepartmentId   
--------------------- 
Item1     | 21,13,9,36      
Item2     | 4,9,44