SQLite -- 分页查询

原文:http://blog.csdn.net/lu1024188315/article/details/51734514

参考:http://www.runoob.com/sqlite/sqlite-limit-clause.html

示例:从第三行开始取3条记录

SELECT * FROM COMPANY LIMIT 3 OFFSET 2;

Android代码处理:

方法一:

String sql = " SELECT * FROM COMPANY LIMIT 3 OFFSET 2 ";
Cursor cursor = db.rawQuery(sql, null);

 

方法二:

Cursor cursor = db.query("company", null, null, null, null, null, null, "2,3");

 

posted @ 2016-10-14 10:36  liDB  阅读(2650)  评论(0编辑  收藏  举报