我的查询:
SELECT tp.EMPCODE,
tp.NAME,
tp.DEPARTMENT,
Group_Concat(d.dte) AbsentDate,
COUNT(tp.EMPCODE) Totalnoofabsentdates
FROM test_prefixmaster tp
JOIN daterange25 d
LEFT JOIN test_prefixtransactions tpt
ON (tp.EMPCODE = tpt.empcode) AND DATE(S_DateTime) = d.dte
WHERE tpt.empcode IS NULL
GROUP BY tp.EMPCODE;
我有一串这样的记录
Empcode AbsentDate
111 2012-11-12,2012-11-23,2012-12-22
我的要求是显示如下记录:
Empcode AbsentDate
111 2012-11-12
2012-11-23
2012-12-22
如何在 MySql 中显示记录?
注意:在我的查询中,如果我删除 Group_Concat 函数,则会显示 2012-11-12 记录(跳过 2012-11-23、2012-12-22)