android.database.sqlite.SQLiteException:在“组”附近:语法错误(代码1):

Par*_*tel 2 sqlite android

错误

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 );
Run Code Online (Sandbox Code Playgroud)

码:-

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 );";
Run Code Online (Sandbox Code Playgroud)

ism*_*a3l 7

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

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