急呀!!!为什么我翻页的程序到了30页以后显示的都是一样的内容呀~~~~~~~~~~~~~

ycagri 2005-08-04 08:45:40
select top 9 * from starphoto where id not in (select top 270 id from starphoto where picStyle=0 order by HotLink desc) and picStyle=0 order by HotLink desc;

我在查询分析器里输出结果,从270------到700都显示的同一页的内容,我的表里有884条记录
如果我将HotLink换成id就显示的内容不一样
select top 9 * from starphoto where id not in (select top 270 id from starphoto where picStyle=0 order by id desc) and picStyle=0 order by id desc;

可我想按点击率(HotLink)排序输出,急呀,而且奇怪的事同样的操作为什么有的表是好的,而且StarPhoto的前30页也是好好的
...全文
94 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
rivery 2005-08-04
  • 打赏
  • 举报
回复
你按照HotLink来排序,但是HotLink可能会有多个相同。
而这很容易造成分页的错误。或数据的重复显示。
还是按照唯一值来排序的好。
你可以
order by HotLink DESC,id DESC
作为所有的排序
ycagri 2005-08-04
  • 打赏
  • 举报
回复
有谁遇到过这种情况呀~~~~~~~~~~我都快疯了

34,575

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧