group_concat与concat()

concat()函数

1、功能:将多个字符串连接成一个字符串。

2、语法:concat(str1, str2,...)

返回结果为连接参数产生的字符串,如果有任何一个参数为null,则返回值为null。

 

group_concat()函数

功能:将group by产生的同一个分组中的值连接起来,返回一个字符串结果。

如:

      ------->

SELECT t.id,group_concat(url) gurl
from test t GROUP BY t.id;

原文地址:https://www.cnblogs.com/2016-cxp/p/11039235.html