原文地址:https://blog.csdn.net/weixin_43275631/article/details/112061685
select *
from ( SELECT
max(START_TIME) AS startTime,
jobstatus AS monitorStatus,
TASKCONFIGID AS id
FROM
T_S_TASK_MONITOR_LOG
GROUP BY TASKCONFIGID,jobstatus ) as TBL
WHERE
NOT EXISTS ( SELECT 1 FROM T_S_TASK_MONITOR_LOG WHERE START_TIME > TBL.startTime AND TBL.ID = TASKCONFIGID )
order by startTime desc
网友评论