这条SQL分页语句有什么错误?

txlty 2006-04-22 10:43:37
系统说这句有错误.
--------------------------就是这句--------------------------------------

rs.open "select top 20 * from [infomation] where touserid=("&userid&") and id > (select max(id) from (select top (page-1)*20 id from [infomation] order by id desc)) order by id desc",cn

----------------------------结束-----------------------------------------
注:
infomation为数据表,ID和touserid为数据项,userid为已经获得的数值,page为已经获得的页码
...全文
176 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
txlty 2006-04-30
  • 打赏
  • 举报
回复
已经可以了:)
txlty 2006-04-30
  • 打赏
  • 举报
回复
给不了
谁回复一下
txlty 2006-04-30
  • 打赏
  • 举报
回复
谢谢了,给分!!!!!!!!!!!!!!!!!
i三千 2006-04-22
  • 打赏
  • 举报
回复
select top 20 时,注意不能出现select top 0

上边Tikyliu(天外飞仙) 已经提示了.你要提前判断.
i三千 2006-04-22
  • 打赏
  • 举报
回复
这样试试:

rs.open "select top 20 * from [infomation] where touserid="&userid&" and id > (select max(id) from (select top "&(page-1)*20&" id from [infomation] order by id desc) as temp) order by id desc",cn
Tikyliu 2006-04-22
  • 打赏
  • 举报
回复
page=1时会是什么样的结果?我很期待。
sxsgssgs 2006-04-22
  • 打赏
  • 举报
回复
http://www.pconline.com.cn/pcedu/empolder/wz/asp/0311/248396.html

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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