如果循环依次取出数据库中的前10条记录?求语句

lostmoon2000 2005-03-15 08:44:05
如果循环依次取出数据库中的前10条记录?求语句
...全文
142 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
kevinnewtec 2005-03-16
  • 打赏
  • 举报
回复
前面刚刚有人问过,我已经回答了
楼主以后法帖先搜索一下哈
你的点数天掉的呀
wfwclyms 2005-03-16
  • 打赏
  • 举报
回复
sql="select top 10 * from 表名 order by 字段名 [desc]"
jyzxpboy 2005-03-16
  • 打赏
  • 举报
回复
同上very easy question
peijunfeng 2005-03-15
  • 打赏
  • 举报
回复
rs.open "select top 10 * from tableName order by 字段名 [desc]"
while not rs.eof
response.write rs("字段名")
rs.movenext
wend
默认好像是降序排列
纪俊 2005-03-15
  • 打赏
  • 举报
回复
rs.open "select top 10 * from [tableName] 这里可以加入条件或者规定按照什么进行排序并规定正序或者倒序"
纪俊 2005-03-15
  • 打赏
  • 举报
回复
rs.open "select top 10 * from [tableName]"
do while not rs.eof
response.write rs("字段名")
rs.movenext
loop

28,391

社区成员

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

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