SQL server中怎么写这样的SQL?

gln 2003-12-09 06:44:54
假如我有个user表,我想查询符合某些条件的第50个用户开始的10个用户,且不能使用id号between and那样查询,应该怎么写SQL语句?
在mysql数据库中有limit,offset语句可以方便的实现,那么在SQL server中呢?SQL Server是否支持limit和offset语句呢?
...全文
52 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
youngby 2003-12-09
  • 打赏
  • 举报
回复
还是猩猩们厉害的
youngby 2003-12-09
  • 打赏
  • 举报
回复
select top 10 a.* from user a where id>50
txlicenhe 2003-12-09
  • 打赏
  • 举报
回复
select top 10 * from
(select top 60 * from [user] order by userid) aa
order by userid desc

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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