我在Android中的数据库上运行以下查询
SQLiteDatabase db = this.getWritableDatabase();
Cursor c;
String Query = "Select * from SubCategory_List where CatId = (Select _id from Category_List where Name = ?) order by Name ASC";
c = db.rawQuery(Query, new String[] { CatName });
我使用此光标填充listview。在android 4.0中我获得了所需的输出,但是在2.3中没有显示vales。
答案 0 :(得分:0)
改变这个:
String Query = "Select * from SubCategory_List where CatId = (Select _id from Category_List where Name = ?) order by Name ASC";
由此:
String Query = "Select * from SubCategory_List where CatId IN (Select _id from Category_List where Name = ?) order by Name ASC";
(更改=进入IN)