2017魔灵召唤排行:select top 10 * 问题

来源:百度文库 编辑:高考问答 时间:2024/04/30 16:30:37
select top 10 * from table 这是提取数据库前 10 条记录

我只想要 10--20 间的10条记录怎么写呢?

do while not rs.eof and i<=20
i=i+1
if i>=10 then
.....
end if
rs.movenext
loop

具体表达记不清了,不过这个思想我认为是可以的:

先选出前20条记录,再加一个过滤条件除去前10条记录,大概框架是(可不是答案呀,细节自己规范吧):

select top 20 * from table where NOT top 10

或者

select top 20 * AND NOT top 10 * from table

提出20条
从第11条开始读取

不用这么复杂吧··
直接select * from table limit 10 10这样就可以了
limit后面2个差数分别是从第10条开始取··只取10条··这样就可以达到你的目的了···