如何在MS Access中选择第n行?

编程入门 行业动态 更新时间:2024-10-28 20:29:18
本文介绍了如何在MS Access中选择第n行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个MS Access数据库,正在处理其中一个表.当我按日期使用选择查询顺序时,它给出了大约1000行.我只想显示第三行.如何使用仅向我提供第三行输出的选择查询?

I have a MS Access database and I am working on one of its table. When I use the select query order by date, it gives 1000 approx rows. I want to display the 3rd row only. How can I use the select query that provides me with an output of 3rd row only?

推荐答案

嵌套查询可以做到,就像这样:

nested query would do it, something like this:

declare @table table (id int) insert into @table values (1),(2),(3),(4),(5) select top 1 id from ( select top 3 id from @table order by id desc ) t order by t.id asc

刚刚注意到您说它是MS-Access,但选择查询仍然是相同的

Just noticed you said it was MS-Access, The select query would still be the same

更多推荐

如何在MS Access中选择第n行?

本文发布于:2023-10-23 08:27:53,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1520314.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何在   MS   Access

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!