我正在尝试找到QA和生产环境中的表(Oracle)中的差异,为此我创建了DB链接并使用此查询。
Select column1, column2, column3 from table1--This is QA table
minus
(Select column1, column2, column3 from table1@prod)--This is Production table
column1,column2,column3创作独特的记录,该表还具有"创建日期"one_answers"创建"列(对于生产和质量质量标准的给定记录可能不相同),我想为记录显示,在质量检查中,但不在生产中。可以在不使用加入的情况下完成吗?
您是否尝试过not exists
子句?
select *
from table1 q
where not exists (
select 1
from table1@prod p
where p.column1 = q.column1
and p.column2 = q.column2
and p.column3 = q.column3
)