Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/powerbi/2.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
Oracle11g 选择其他表中不存在的记录_Oracle11g - Fatal编程技术网

Oracle11g 选择其他表中不存在的记录

Oracle11g 选择其他表中不存在的记录,oracle11g,Oracle11g,我想得到x中表A中不存在的所有值 我尝试了以下返回空白的查询 select x.num from ( select '888888' as num from dual union all select '111111' as num from dual ) x left outer join TableA a on (a.number = x.num) where a.number is null select x.num FROM ( select '888888'

我想得到x中表A中不存在的所有值

我尝试了以下返回空白的查询

select x.num from 
(
   select '888888' as num from dual union all
   select '111111' as num from dual
) x 
left outer join TableA a on (a.number = x.num)
where a.number is null


select x.num
FROM
(
    select '888888' as num from dual union all
    select '111111' as num from dual
) x
where x.num not in
(
    select a.number from TableA a where x.num = a.number
)
表格

| TableA.number |
-------------
  111111
  333333
预期结果是在这种情况下只返回“888888”

我不明白为什么这不起作用,我哪里做错了?

试试这个

with cte as
(
   select '888888' as num from dual union all
   select '111111' as num from dual
)  
select cte.num 
from cte
left join TableA a on (a.number = cte.num)
where a.number is null