从记录集中获取特定行
我有一个很大的数据库结果集,我想通过 1 个查询从中获取特定行:
1.、60.
和 61.,120。
和121.,180。
...并且每第 60 条和第 61 条记录,直到我拥有全部,完整的结果需要由 1 个查询提供。
知道我该怎么做吗?
LIMIT/OFFSET 不是我想要的,因为我需要重复很多次。
I have a big database result set and I want get specific rows from them with 1 Query:
1., 60.
and 61.,120.
and 121.,180.
... and every 60th and 61st record until I have all, the complete result needs to be provided by 1 Query.
Any idea how I can do that?
The LIMIT/OFFSET is not what I'm looking for, as I would need to repeat it many times.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现一篇文章使用单个 select 语句来执行此操作。该声明本身更为复杂,但无论如何并不神秘。
这是这篇文章。< /a>
I found an article that uses a single select statement to do this. The statement itself is more complex, but certainly not cryptic by any means.
Here is the article.
*未经测试怎么样
!
How about
*untested!