#自表联合查询
SELECT * FROM
ts_running r
join (
SELECT
max(r_w_time) as r_w_time,
f_code
from ts_running t
group by f_code
) v
on r.f_code = v.f_code
and r.r_w_time = v.r_w_time;
#分组拼接字段内容
SELECT
GROUP_CONCAT(tr_sort SEPARATOR ';'),
ps_flow_code
FROM
ts_tardiness_reson
GROUP BY
ps_flow_code;