GROUP_CONCAT(函数),一般和GROUP BY 一起使用.
SELECT t.belong_dept_id,ti.ent_dept_id,ti.ent_dept_name,COUNT(*) AS unFinishCount,GROUP_CONCAT(DISTINCT ti.task_name) AS taskName
FROM t_oa_oaline_task t, t_oa_oaline_task_ins ti
WHERE ti.examState<>2
AND ti.examState<>''
AND ti.examState IS NOT NULL
AND t.id=ti.task_id
AND t.remindLearnTime=DATE_FORMAT(SYSDATE(),'%Y-%m-%d')
GROUP BY t.belong_dept_id