全部博文(137)
分类: Mysql/postgreSQL
2010-02-23 09:40:57
mysql已经写好了group_concat函数,直接调用即可。
mysql> SELECT group_concat( `UID` SEPARATOR ',' ) AS allrow FROM `test` WHERE id<10; +-------------------+ | allrow | +-------------------+ | 1,2,3,4,5,6,7,8,9 | +-------------------+ 1 ROW IN SET (0.00 sec)