1、concat()
将多个字符串连接成一个字符串
select concat("AAA",",","BBB") mysql>AAA,BBB
2、concat_ws()
引入连接符进行连接 select concat_ws(",","111","222") mysql>111,222
3、group_concat
将group by产生的同一个分组的值连接起来,而且可以指定分隔符
select dept_no, group_concat(emp_no,separator ',') as employee from employees group by dept_no
dept_no employee
A A1,A2,A4,A11,A43
B B1,B5,B6,B11,B43
C C2,C4,C7,C13