I'm looking to write a database script that will go through a table and will give me one comma separated output.
I need to do this all in a one off script. I was thinking about starting with a temp table of just the IDs and then getting all of the items but I'm not really sure how to "foreach" a database.
What I have                    What I'm looking for
 ID | Items                       ID | Items
 1  |  A                          1  | A,B,C,D
 1  |  B                          2  | A,B,C
 1  |  C                          3  | B,C
 1  |  D
 2  |  A
 2  |  B
 2  |  C
 3  |  B 
 3  |  C
 
     
    