Possible Duplicate:
SQL: Aggregating strings together
Hi, I have some data which looks like this for example:
TYPE FOOD
Fruit Orange
Fruit Apple
Fruit Pear
Vegetable Carrot
Vegetable Cabbage
And i want to write a query to give group by the "TYPE" column and concatenate the values in the "FOOD" column as a comma separated list, so the results would be:
Fruit Orange,Apple,Pear
Vegetable Carrot,Cabbage
How would i do this?
Thanks A