日期:2014-05-17  浏览次数:20450 次

奇葩了,sqlserver分页时第五页数据和第六页数据一样
我用了order by  进行了排序,但是出来第五页和第六呀数据相同,怎么查也查不到原因,哪位遇到或者觉得可能性是什么,告知下我,感激不尽!!!!看图
分页 不同页显示相同数据

------解决方案--------------------
where ChanDueMan=1 and (ChanState=3 or ChanState=4 or ChanState=2) order by ChanID 楼主、可以的话给分呦
------解决方案--------------------
引用:
Quote: 引用:

说的再明白一点就是你在最后的条件用括号把这层条件括起来就行了。()就这样


哥们太感谢你了,原来就是这个括号的问题。但是你这样打括号出错了,应该是下面这样
select top 2 * from Chances where ChanID not in(
select top ((6-1)*2) ChanID from Chances 
where (ChanState=3 or ChanState=4 or (ChanState=2 and ChanDueMan=1)) 
order by ChanID asc
) and (ChanState=3 or ChanState=4 or (ChanState=2 and ChanDueMan=1)) order by ChanID asc
ok我也谢谢你。。