I am writing an SQL query like this:
Cursor data = db.query(WhereWolfOpenHelper.FRIEND_TABLE_NAME, null, WhereWolfOpenHelper.FRIEND_GROUP_COLUMN+"="+params[0], null, null, null, null);
And it’s producing the following error:
ERROR/AndroidRuntime(620): Caused by: android.database.sqlite.SQLiteException: no such column: Friends: , while compiling: SELECT * FROM ww_friend WHERE friend_group=Friends
There is no column called Friends, I want to retrieve the rows where the friend_group column has the value Friends. What am I doing wrong?
you need to surround Friend value with quote :
PS: be sure to escape dangerous characters from param[0] when you do like this to avoid SQL Injection