I have a table that looks like:
Event ID Name
1 Bob
1 Steve
1 Tom
2 Bob
3 Steve
3 Tom
There are thousands of event IDs, and tens of unique names. I'd like an SQL query to return the following table:
Event ID Names
1 Bob, Steve, Tom
2 Bob
3 Steve, Tom
I'm looking for an aggregate function like SUM()
or AVG()
except that it joins strings instead of does mathematics.
EDIT: I'm stuck using MS Access on this one.
EDIT 2: I realize that this would be trivial in a client language, but I'm trying to see if I can get an all-SQL solution.