Mysql 查询一列(id)用逗号连接

 

GROUP_CONCAT(`id`)

 

mysql>  select GROUP_CONCAT(`id`) from d_articles where image like '%////%';
+----------------------------------------------------------------------------------+
| GROUP_CONCAT(`id`)                                                                                                                                                                                        |
+----------------------------------------------------------------------------------+
| 2665,2666,2667,2668,2669,2671,2672,2673 |
+----------------------------------------------------------------------------+