标签:src blog http alt 字段 cat group by name img
测试数据表
以product_id;分组,把name字段的值打印在一行,逗号分隔(默认)
SELECT id,GROUP_CONCAT(name) FROM test_brand GROUP BY product_id;
以id分组,把name字段的值打印在一行,分号分隔
SELECT id,GROUP_CONCAT(name SEPARATOR ‘;‘) FROM `test_brand` GROUP BY product_id;
标签:src blog http alt 字段 cat group by name img
原文地址:http://www.cnblogs.com/zelzzz/p/7496884.html