select *
from (select top 200000 * from testtb) t1
where not exists(select 1 from (select top 199999 id from testtb) t2 where t1.id=t2.id)
from (select top 200000 * from testtb) t1
where not exists(select 1 from (select top 199999 id from testtb) t2 where t1.id=t2.id)
当然有用啦,不然拿来干嘛.有什么好方法就麻烦你说一声吧!!to:SE1()
不行啊,这个也不怎样,和我的差不多.
SE1() 大侠得比你的要好,至少再有断号得情况下,不会跟你的一样返回多条记录;而且,效率肯定比你得要高
是吗?谢谢你的提点.
to: lixigang(就怕认真)
我那里ID字段已经是"自增长列",而且有断号出现
大家还有别的参考吗?