美文网首页
SQL Where not exists(排除)双重否定例子分析

SQL Where not exists(排除)双重否定例子分析

作者: 催化剂 | 来源:发表于2022-07-14 10:41 被阅读0次

    原文地址: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

    相关文章

      网友评论

          本文标题:SQL Where not exists(排除)双重否定例子分析

          本文链接:https://www.haomeiwen.com/subject/ynvxirtx.html