开发者

SQLite select x-th row

let's suppose I have this table, where I deleted the row with rowid=3:

rowid | something
------+-----------
    开发者_JAVA技巧1 | ...
    2 | ...
    4 | ...
    5 | ...

How to select the third row (the one with rowid=4) ?


select * from table limit 2,1

Means something like "start from index 2 and return 1 row."


select * from yourtable order by rowid limit 1 offset 2;

Will get you the third row in that sorted result set (offset is 0-based).


select Max(row_id) from ( select * from table_name limit 3)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜