查找不符合条件的行
Find Rows that DO NOT meet criteria
我正在尝试验证更新参与分数的新夜间程序。我有一个从验证返回的 461 个 ID # 的列表....在下面的查询中确认返回的信息是正确的,我发现 461 个中有 233 个符合使用下面的代码的条件。我的问题是找到不符合标准的行。任何帮助,将不胜感激!谢谢
SELECT DISTINCT * FROM TEMP_TABLE w
JOIN entity e ON e.id_number = w.id_number
AND e.id_number IN (‘ ID NUMBERS IN QUESTION PUT HERE ‘)
JOIN xcomment c ON c.id_number = e.id_number
AND c.comment_code = 'ES'
WHERE EXISTS (SELECT 1 FROM activity a
WHERE a.id_number = e.id_number
AND to_char(a.date_added, 'YYYYMMDD') >= '20180101'
AND to_char(a.date_added, 'YYYYMMDD') <= '20180307')
SELECT DISTINCT * FROM TEMP_TABLE w
JOIN entity e ON e.id_number = w.id_number
AND e.id_number IN (‘ ID NUMBERS IN QUESTION PUT HERE ‘)
JOIN xcomment c ON c.id_number = e.id_number
AND c.comment_code = 'ES'
WHERE not EXISTS (SELECT 1 FROM activity a
WHERE a.id_number = e.id_number
AND to_char(a.date_added, 'YYYYMMDD') >= '20180101'
AND to_char(a.date_added, 'YYYYMMDD') <= '20180307')
我正在尝试验证更新参与分数的新夜间程序。我有一个从验证返回的 461 个 ID # 的列表....在下面的查询中确认返回的信息是正确的,我发现 461 个中有 233 个符合使用下面的代码的条件。我的问题是找到不符合标准的行。任何帮助,将不胜感激!谢谢
SELECT DISTINCT * FROM TEMP_TABLE w
JOIN entity e ON e.id_number = w.id_number
AND e.id_number IN (‘ ID NUMBERS IN QUESTION PUT HERE ‘)
JOIN xcomment c ON c.id_number = e.id_number
AND c.comment_code = 'ES'
WHERE EXISTS (SELECT 1 FROM activity a
WHERE a.id_number = e.id_number
AND to_char(a.date_added, 'YYYYMMDD') >= '20180101'
AND to_char(a.date_added, 'YYYYMMDD') <= '20180307')
SELECT DISTINCT * FROM TEMP_TABLE w
JOIN entity e ON e.id_number = w.id_number
AND e.id_number IN (‘ ID NUMBERS IN QUESTION PUT HERE ‘)
JOIN xcomment c ON c.id_number = e.id_number
AND c.comment_code = 'ES'
WHERE not EXISTS (SELECT 1 FROM activity a
WHERE a.id_number = e.id_number
AND to_char(a.date_added, 'YYYYMMDD') >= '20180101'
AND to_char(a.date_added, 'YYYYMMDD') <= '20180307')