如何快速比较两个表相同的记录个数
有两个表,它们各有记录,如何快速比较两个表中相同记录的个数(只是个数,不要求具体的哪些记录),我对效率比较关注。
谢谢。
[解决办法]
- SQL code
select * from aunion allselect * from b where not exists (select 1 from a where c1=b.c1 and c2=b.c2)
发布时间: 2012-06-06 16:44:11 作者: rapoo
如何快速比较两个表相同的记录个数
有两个表,它们各有记录,如何快速比较两个表中相同记录的个数(只是个数,不要求具体的哪些记录),我对效率比较关注。
谢谢。
[解决办法]
select * from aunion allselect * from b where not exists (select 1 from a where c1=b.c1 and c2=b.c2)