摘要: 老话题了,主要是看下测试数据,不同数量级的效率是不一样的,具体差别很大滴!!,看许多人都说是row number效率最低,但是本人测试结果有点出入。10万级别的基本没啥差距,百万级别的差距不是太明显,但是not in变慢,千万级别的差距就很明显了,not in明显跟不上了。总体比较而言,还是max(id)效率最高,但是不通用。row number比较通用。PS:上亿的就别玩了,还是分表吧!!方法1...阅读全文
09 2010 档案
摘要: select name from testB a where exists( select * from testB b where b.InsertTime = DATEADD(D,1,a.InsertTime) and a.name=b.name) and exists( select * from testB b where b.InsertTime = DATEADD(D,2,a.Inse...阅读全文