老大,怎么返回当前纪录相关的上下10条记录

张群区块链
业界专家认证
2004-06-21 07:43:31
老大,我使用"select * from hgist where city='qingdao' and id="&request("id")找到了一条记录,怎么得到与它相关的(city='qingdao')的上下10条记录?
...全文
92 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
CsdnRob 2004-07-02
  • 打赏
  • 举报
回复
应该是This is name $this->name,hello $this->name
张群区块链 2004-06-21
  • 打赏
  • 举报
回复
哦,老大,知道了,谢谢昂~~~~ 我加分
cometzg 2004-06-21
  • 打赏
  • 举报
回复
来晚了,楼上的对。要想得到上下十条记录用一条SQL语句是不能解决问题的。
野马 2004-06-21
  • 打赏
  • 举报
回复
id = request("id")
"select * from hgist where city='qingdao' and id="&id
找到 true
前10条记录
"select top 10 * from hgist where city='qingdao' and id<"&id&" order by id desc"

后10条记录
"select top 10 * from hgist where city='qingdao' and id>"&id

28,390

社区成员

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

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