(1) select count(*) from t1 where object_id not in ( select object_id from t2);
(2) select count(*)
from t1
where not exists
(select null from t2 where t2.object_id = t1.object_id);
(3)select count(*)
from t1, t2
where t1.object_id = t2.object_id
and t2.object_id IS NULL;问这三个语句效率比较,数据量在千万
(数据库为DB2或MS SQL2005)
(2) select count(*)
from t1
where not exists
(select null from t2 where t2.object_id = t1.object_id);
(3)select count(*)
from t1, t2
where t1.object_id = t2.object_id
and t2.object_id IS NULL;问这三个语句效率比较,数据量在千万
(数据库为DB2或MS SQL2005)
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货