这是错误
android.database.sqlite.SQLiteException:靠近“FROMfriendsWHERE”: 语法错误:,编译时:SELECT * FROMfriendsWHERE id!=?
这是我的代码
Cursor cursor = db.rawQuery("SELECT * FROM "+FriendsDBHelper.TABLE_NAME+" WHERE id != ?",new String[]{Integer.toString(0)});
答案 0 :(得分:0)
尝试
Cursor cursor = db.rawQuery("SELECT * FROM "+FriendsDBHelper.TABLE_NAME+" WHERE id NOT LIKE ?",new String[]{Integer.toString(0)});
NOT LIKE
用于do not have ? value in it
或者
Cursor cursor = db.rawQuery("SELECT * FROM "+FriendsDBHelper.TABLE_NAME+" WHERE id <> ?",new String[]{Integer.toString(0)});
<>
用于is not equal to ?