Expression #4 of SELECT list is not in GROUP BY clause and contains nonaggregated column '数据库名称.表名.ticket_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

解决办法:

SELECT GROUP_CONCAT(ticket_id)

字段值如"1,2,3" 逗号分割 查找用FIND_IN_SET


sprintf("FIND_IN_SET('%d', role_id)", $roleId);