美文网首页编程笔记
SQL 差集计算的例子

SQL 差集计算的例子

作者: 光剑书架上的书 | 来源:发表于2018-05-16 21:55 被阅读103次
SELECT a.assigned_to_workno from (SELECT DISTINCT(assigned_to_workno) from issue )  a
where a.assigned_to_workno not in 
(SELECT work_no FROM employee WHERE is_active = 'y');



SELECT * FROM issue WHERE assigned_to_workno in 
(SELECT a.assigned_to_workno from (SELECT DISTINCT(assigned_to_workno) from issue )  a
where a.assigned_to_workno not in 
(SELECT work_no FROM employee)
);


相关文章

网友评论

    本文标题:SQL 差集计算的例子

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