group_concat 函数
默认“,”合并
select
p.id as patent_id,p.application_no,p.name,p.inventer,group_concat(pi.`name`) as sys_inventer
from ip_patent
用指定符号分割
select p.id as patent_id,p.application_no,p.name,p.inventer,group_concat(pi.`name` separator ';') as sys_inventer from ip_patent
多个字段用指定的符号分割
SELECT
p.id as patent_id,p.application_no,p.name,p.applicant,p.inventer,
group_concat(CONCAT(u.`name`, '(', u.`code`, ')') SEPARATOR ';') AS sys_inventer,p.tenant_id