回複:how to deal exist? 不搞的這麽複雜

來源: 2013-03-05 20:21:46 [舊帖] [給我悄悄話] 本文已被閱讀:

select * from tableA
union
select * from tableB
where not exists(select * from tableA where pk = tableB.pk)

or

select * from tableA
union
select * from tableB
where pk not in (select pk from tableA)

or use union all