梦醉荷塘下载:如何用在SQL中显示一个列表中的5到10行
来源:百度文库 编辑:高校问答 时间:2024/04/27 16:36:27
但是我的id是自增的,怎么判断,请大家给出更好解决办法
一楼的方式最可取
我改一下先top 10然后
<%
if rs("id")>=5 then
responswrite("XXXXXXXXX")
end if
%>
反正id<5的不输出就行了嘛
就行了
用ID加IF, ELSE, END IF最简单
循环语句不行吗?
select top 5 * from (select top 10 * from table order by id) table order by id desc