具有两个条件的pl/sql排除联接
如果行有(相同的工具和相同的配方),我想进行排除联接 当我运行以下代码时具有两个条件的pl/sql排除联接,sql,join,oracle11g,Sql,Join,Oracle11g,如果行有(相同的工具和相同的配方),我想进行排除联接 当我运行以下代码时 select a.tool, a.recipe from dual a where a.tool NOT IN (select b.tool from daul2 b) and a.recipe NOT IN (select b.recipe from dual2 b) 它首先过滤工具,然后是配方,但我希望程序同时检查它 有什么方法可以同时检查两列吗?我不能完全确定我是否理解你的要求。我猜你也想要 SELECT a.t
select a.tool, a.recipe
from dual a
where a.tool NOT IN (select b.tool from daul2 b)
and a.recipe NOT IN (select b.recipe from dual2 b)
它首先过滤工具,然后是配方,但我希望程序同时检查它
有什么方法可以同时检查两列吗?我不能完全确定我是否理解你的要求。我猜你也想要
SELECT a.tool, a.recipe
FROM table1 a
WHERE (a.tool, a.recipe) NOT IN (SELECT b.tool, b.recipe
FROM table2 b)
或
如果这不是您想要的,您能发布一些示例数据并解释您试图排除和包括的内容吗?我不能完全确定我是否理解您的要求。我猜你也想要
SELECT a.tool, a.recipe
FROM table1 a
WHERE (a.tool, a.recipe) NOT IN (SELECT b.tool, b.recipe
FROM table2 b)
或
如果这不是您想要的,您可以发布一些示例数据并解释您试图排除和包括的内容吗?最好选择“dual”以外的示例表名,因为这是Oracle中的一个特殊表。最好选择“dual”以外的示例表名,因为这是Oracle中的一个特殊表。