What is the best way to group records together by one field, and get a comma-separated list of the values from another? So if I have:
UserID        Code
  1            A
  1            C5
  1            X
  2            V3
  3            B
  3            D
  3            NULL
  3            F4
  4            NULL
I'd get:
 UserID        Code
  1            A,C5,X
  2            V3
  3            B,D,F4
  4            NULL
I'm using SQL Server 2005 database. Thanks for any help.
 
     
     
    