数据库查询语句怎么选择表中具体行数显示

数据库查询语句怎么选择表中具体行数显示,第1张

select top 10 from
(select top 30 from table order by id asc)
as a
order by id desc
排序字段 和排序方法 根据你的表数据调整一下
例 数据是如下形式
id
1
2
3
4
5
sql语句
select top 2 from
(select top 4 from table order by id asc)
as a
order by id desc
得到的结果是
4
3

以上就是关于数据库查询语句怎么选择表中具体行数显示全部的内容,包括:数据库查询语句怎么选择表中具体行数显示、、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/10199689.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-06
下一篇 2023-05-06

发表评论

登录后才能评论

评论列表(0条)

保存