android sqlite limit语法 :
网上有的说法是sqlite3 中limit n,m语法无效,实际是错误的。
正确的语法是
The two syntax forms are a little confusing because they reverse the numbers:
LIMIT <skip>, <count>
等价于
LIMIT <count> OFFSET <skip>
等价于
LIMIT <取数据数目> OFFSET <跳过的数据数目>
其实可以通过orderby作假来加上limit offset,反正最后其实也是由db的query去拼接的sql的,如orderby变为 ID DESC LIMIT 100 OFFSET 0。
query(NoticeColumsStandard.TABLENAME_NOTICE, null, null, null, "_id asc LIMIT 1 OFFSET 2");
等价于 : select * from table order by _id asc limit 1 offset 2