views:

33

answers:

0

Possible Duplicates:
Concat groups in SQL Server
How to use GROUP BY to concatenate strings in SQL Server?

I need a very high-performance query:
This is the original table that I am querying:

userID    group  
1         A  
1         B  
1         D  
2         E  
2         G  
3         Null  

The result I need is like this:

userID    groups  
1         A,B,D   
2         E,G 

I'm working in sql server 2005.