android.database.sqlite.SQLiteException:near“Group”:语法错误(代码1):

时间:2015-07-11 22:18:43

标签: android sqlite

错误

Caused by: android.database.sqlite.SQLiteException: near "Group": syntax error (code 1): , while compiling: create table Group(_id integer primary key autoincrement, GroupName TEXT , MemberName TEXT , TotalExpense TEXT );

代码: -

public static final String CREATE_GROUP_TABLE = "create table " + ROOM_GROUP_TABLE +
            "(" + GROUP_ID + " integer primary key autoincrement, "
            + ROOM_COLUMN_GROUP_NAME + " TEXT , "
            + ROOM_COLUMN_MEMBER_NAME + " TEXT , "
            + ROOM_COLUMN_TOTAL_EXPENSE + " TEXT );";

1 个答案:

答案 0 :(得分:5)

您的表名不能是Group,Group是关键字。

sqlite关键字列表:https://www.sqlite.org/lang_keywords.html