1
,我發現了以下錯誤而編譯SELECT查詢SELECT查詢:收到錯誤:致:android.database.sqlite.SQLiteException:近「TABLENAME」語法錯誤(代碼1)編制
Caused by: android.database.sqlite.SQLiteException: near "group": syntax error (code 1): , while compiling: SELECT group_id, logo FROM group WHERE group_name = 'Empty Group'
創建查詢爲:
c = database.query(TABLE_GROUP, new String[]{KEY_GROUPID, KEY_LOGO}, KEY_GROUPNAME + " = '" + description + "'", null, null, null, null);
有:
TABLE_GROUP = "group";
KEY_LOGO = "logo";
KEY_GROUPID = "group_id";
和表的創建腳本:
create table group
(group_id integer primary key autoincrement,
group_name text not null,
logo string);
任何人都知道什麼是錯的?
請確保您創建了分組表格 –
請確保'group'不是關鍵字。將表格的名稱改爲別的,然後檢查 – Shahzeb