日期:2014-05-16  浏览次数:20917 次

如何快速比较两个表相同的记录个数
有两个表,它们各有记录,如何快速比较两个表中相同记录的个数(只是个数,不要求具体的哪些记录),我对效率比较关注。
谢谢。

------解决方案--------------------
SQL code
select * from a
union all
select * from b where not exists (select 1 from a where c1=b.c1 and c2=b.c2)