注册 登录
编程论坛 ASP技术论坛

sql 查询语句咨询

zwz7075 发布于 2008-04-25 22:51, 590 次点击
设定条件查询,productid随产品的增加而增大,我现在想查询从顶部往下第五条记录应该如何写

select  * from Product where Passed=True order by productID desc

这条是productid号最大的那条往下查的,我需要第最大往下第五条起开始查询,请问如何设定条件?谢谢
3 回复
#2
madpbpl2008-04-26 03:49
select * from Product where ProductID not in (select top 4 ProductID from Product order by ProductID desc) and Passed=True order by productID desc

[[it] 本帖最后由 madpbpl 于 2008-4-26 11:43 编辑 [/it]]
#3
zwz70752008-04-26 09:09
谢谢,还是不行啊
#4
madpbpl2008-04-26 11:43
写错了,2#已经重新编辑过
1