数据库中的语法错误

时间:2012-07-10 05:13:22

标签: android database

在我的应用程序中,我创建了一个数据库(在使用组字段之前它工作正常)。现在我想再创建一个字段(称为组)。我创建了该字段。但是显示以下错误:

android.database.sqlite.SQLiteException: near "group": syntax error: create table incomexpense(_id integer primary key autoincrement,price text not null,description text not null,quantity text not null,total text not null,category text not null,recurrence text not null,date text not null,group text not null);

我的创建命令:

"create table incomexpense(_id integer primary key autoincrement,"+"price text not null,description text not null,"+"quantity text not null,"+"total text not null,"+"category text not null,"+"recurrence text not null,"+"date text not null,"+"group text not null);";

1 个答案:

答案 0 :(得分:4)

group是一个关键字,因此在创建表时不应使用它。