一个分页的SQL语句问题

[复制链接]
查看11 | 回复2 | 2013-8-21 20:39:26 | 显示全部楼层 |阅读模式
假设:pagecount=30 --每页显示的记录数Currentpage=3 --当前页码select top 30 ID,Title from bookswhere Publisheris =(....)and id not in (select top 30*(3-1) id from books where Publisherid =(...) order by id)order by id(...) 跟你那个一样,就不写了,两处都是一样的你的错误是在id not in中没有加那个(...)的条件...
回复

使用道具 举报

千问 | 2013-8-21 20:39:26 | 显示全部楼层
把条件加到分页子查询语句里面就可以了...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行