Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/sql/78.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
具有两个条件的pl/sql排除联接_Sql_Join_Oracle11g - Fatal编程技术网

具有两个条件的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中的一个特殊表。