0

我想检索数据库中的前 20 个项目,然后是后 20 个项目,如在选择变量中如下所示:

String selection = SQLite.firstTableColumns[8]+">="+0+" and "+SQLite.firstTableColumns[8]+"<"+20;
Log.d("search from db","selection "+selection+"  !!!!!!!!!!!");
Cursor cursor = SQLiteDataBase.query("feedFirstTable",SQLite.firstTableColumns,selection, null, null, null, null); 

但它返回一个空的ArrayList.

4

1 回答 1

0

您可以使用这些查询来解决您的问题:

sqlite> SELECT * FROM Cars LIMIT 4;
Id          Name        Cost      
----------  ----------  ----------
1           Audi        52642     
2           Mercedes    57127     
3           Skoda       9000      
4           Volvo       29000     
The LIMIT clause limits the number of rows returned to 4.

sqlite> SELECT * FROM Cars LIMIT 2, 4;
Id          Name        Cost      
----------  ----------  ----------
3           Skoda       9000      
4           Volvo       29000     
5           Bentley     350000    
6           Citroen     21000  
This statement selects four rows skipping the first two rows.
于 2013-08-16T04:33:07.870 回答