Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android sqlite where子句条件_Android_Sqlite_Where Clause - Fatal编程技术网

Android sqlite where子句条件

Android sqlite where子句条件,android,sqlite,where-clause,Android,Sqlite,Where Clause,我希望检索数据库中的前二十项,然后检索第二二十项,如选择变量中所示: String selection = SQLite.firstTableColumns[8]+">="+0+" and "+SQLite.firstTableColumns[8]+"<"+20; Log.d("search from db","selection "+selection+" !!!!!!!!!!!"); Cursor cursor = SQLiteDataBase.query("feedFirst

我希望检索数据库中的前二十项,然后检索第二二十项,如选择变量中所示:

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); 

String selection=SQLite.firstTableColumns[8]+“>=”+0+”和“+SQLite.firstTableColumns[8]+”您可以使用这些查询来解决问题:

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.

如果您已将表中的行ID设置为自动递增。然后根据需要使用行ID来获取数据数。firstTableColumns[8]是行ID,并且是自动递增的,您是否尝试过使用BETWEEN运算符?是否有错误?是的,我有,但没有返回任何结果