这是错误
android.database.sqlite.SQLiteException:靠近“FROMfriendsWHERE”:语法错误:,编译时:SELECT * FROMfriendsWHERE id!=?
这是我的代码
Cursor cursor = db.rawQuery("SELECT * FROM "+FriendsDBHelper.TABLE_NAME+" WHERE id != ?",new String[]{Integer.toString(0)});
这是错误
android.database.sqlite.SQLiteException:靠近“FROMfriendsWHERE”:语法错误:,编译时:SELECT * FROMfriendsWHERE id!=?
这是我的代码
Cursor cursor = db.rawQuery("SELECT * FROM "+FriendsDBHelper.TABLE_NAME+" WHERE id != ?",new String[]{Integer.toString(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 ?