本文介绍了在SQLite中选择语句识别行号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想编写类似这样的SQLite语句:
I want to write SQLite statement something like this:
SELECT * FROM Table WHERE RowNumber BETWEEN 1 AND 10;
但我没有这样的列RowNumber。我的桌子上有主键。但是我可以使用默认的行号吗?
but i don't have such column RowNumber. I have primary key in my table. But is there row number by default that i could use ?
此外,我正在搜索有关编写更复杂的SQLite语句的信息。因此,如果您在书签中有一些链接,请分享。
Also i am searching info about writing more complicated SQLite statement. So if you have some links in bookmarks please share.
谢谢。
推荐答案
您想使用
SELECT * FROM Table LIMIT 10 OFFSET 0
也可以用以下简写语法表示
Which can also be expressed with the following shorthand syntax
SELECT * FROM Table LIMIT X,Y
其中 X
表示偏移,这是独占的,并且 Y
表示数量,例如
Where X
represents the offset, which is exclusive, and Y
represents the quantity, so for example
SELECT * FROM Table LIMIT 50,50
将返回行51-100
Would return rows 51-100
这篇关于在SQLite中选择语句识别行号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!