Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取错误:由以下原因引起:android.database.sqlite.SQLiteException:near";TABLENAME";编译SELECT查询时出现语法错误(代码1)_Android_Sqlite - Fatal编程技术网

获取错误:由以下原因引起:android.database.sqlite.SQLiteException:near";TABLENAME";编译SELECT查询时出现语法错误(代码1)

获取错误:由以下原因引起:android.database.sqlite.SQLiteException:near";TABLENAME";编译SELECT查询时出现语法错误(代码1),android,sqlite,Android,Sqlite,编译SELECT查询时出现以下错误: 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_

编译SELECT查询时出现以下错误:

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);
与:

以及表的创建脚本:

create table group 
(group_id integer primary key autoincrement, 
group_name text not null, 
logo string);

有人知道出了什么问题吗?

组是一个
SQLITE
关键字,与每个保留字一样,它不能将其用作表/列名。要修复,请为列选择其他名称。您可以找到
SQLITE
保留关键字的列表

确保您已在数据库中创建了组表确保“group”不是关键字。将表的名称更改为其他名称,然后检查您是否完全正确。我完全忘记了SQL中可以使用“groupby”。我需要有人记得我!非常感谢。
create table group 
(group_id integer primary key autoincrement, 
group_name text not null, 
logo string);