分类: Mysql/postgreSQL
2011-12-14 23:05:04
Basically the question is how to get from this:
id string 1 A 1 B 2 Cto this:
id string 1 A B 2 CSELECT id, GROUP_CONCAT(string SEPARATOR ' ') FROM table GROUP BY id;
http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html#function_group-concat