如何使用group_concat

1358阅读 0评论2011-12-14 sss0213
分类:Mysql/postgreSQL

Basically the question is how to get from this:

id string 1 A 1 B 2 C

to this:

id string 1 A B 2 C

SELECT 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


上一篇:InnoDB死锁检测
下一篇:使用mysqlhotcopy备份数据库