0

QAのテーブルと、DBリンクを作成してこのクエリを使用している本番環境(Oracle)のテーブルの違いを見つけようとしています。

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は一意のレコードを作成し、テーブルには「作成日」と「作成者」の列もあります(本番環境とQAの特定のレコードでは同じではない場合があります)。 QAですが、本番環境ではありません。これは、結合を使用せずに実行できますか?

4

1 に答える 1

0

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
                 )
于 2012-10-22T07:15:52.850 に答える