且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在sql中实现excel的OFFSET功能

更新时间:2023-09-23 09:07:40

我不认为这是SQL中的有效概念,尽管它在大多数查询结果中显示如Excel SQL完全不同,那里SQL中没有行偏移的概念(甚至列偏移也不相同)。行并不是真正相互关联,所以你不能说一行与另一行有一定的距离。



你可以做一些复杂的内部选择以获得你想要的数据,如果你给我们一个你的数据和你的例子会有所帮助我想回来。
I don't think this is a valid concept in SQL, despite it being displayed in most query results like Excel SQL is completely different, there are no concepts of row offsets in SQL (even column offsets are not the same). Rows are not really related to each other, so you can't say that one row is a certain "distance" from another row.

You may be able to do some kind of complicated inner select to get the data you want, it would help if you gave us an example of your data and what you would like to have returned.