SELECT
u.person_name,
u.account_code,
u.person_code,
GROUP_CONCAT
(DISTINCT ar.compound_name SEPARATOR ',') as compoundName,
GROUP_CONCAT
(DISTINCT r.role_name SEPARATOR ',') as roleName,
GROUP_CONCAT
(DISTINCT ar.region_name SEPARATOR ',') as regionName,
GROUP_CONCAT
(DISTINCT ar.province_name SEPARATOR ',') as provinceName
FROM
sys_user u
JOIN sys_role_account a ON u.account_code = a.account_code
JOIN sys_role r ON a.role_id = r.role_id
JOIN sys_role_account_region ar ON ar.account_code = u.account_code
报错信息
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DISTINCT ar.compound_name SEPARATOR ',') as compoundName,
GROUP_CONCAT
' at line 6
时间: 0.34s