2012-10-22 25 views
0

我試圖找到QA和生產環境(Oracle)中的表之間的差異,爲此我創建了數據庫鏈接並使用此查詢。查找QA中的表與生產環境(Oracle)之間的區別

Select column1, column2, column3 from table1--This is QA table 
minus 
(Select column1, column2, column3 from [email protected])--This is Production table 

列1,列2,欄3做一個獨特的記錄,該表還列「創建日期」和「創造」(可能不相同的生產和QA給定的記錄),我想顯示QA中的記錄,但不顯示在生產中。這可以在不使用Join的情況下完成嗎?

回答

0

您試過not exists條款嗎?

select * 
from table1 q 
where not exists (
        select 1 
        from [email protected] p 
        where p.column1 = q.column1 
        and p.column2 = q.column2 
        and p.column3 = q.column3 
       ) 
相關問題