My cities
table:
year | id | city
2005 10 LA
2005 11 SF
2007 12 NY
2008 13 NO
with the query:
SELECT year, GROUP_CONCAT(id)
FROM cities
GROUP BY year
I get the output:
2005|10,11
2007|12
2008|13
But what I would like to get is something like (for example):
2005|10,LA,11,SF
2007|12,NY
2008|13,NO
In other words I would like both the id and the name in the result, grouped by year, and not just the id. How does one do that?