oracle diff: how to compare two tables?

后端 未结 12 1950
忘了有多久
忘了有多久 2021-01-31 03:22

Suppose I have two tables, t1 and t2 which are identical in layout but which may contain different data.

What\'s the best way to diff these two tables?

12条回答
  •  遥遥无期
    2021-01-31 03:57

    Try:

    select distinct T1.id
      from TABLE1 T1
     where not exists (select distinct T2.id
                         from TABLE2 T2
                        where T2.id = T1.id)
    

    With sql oracle 11g+

提交回复
热议问题