我查看了与我的问题类似的其他问题和答案,但没有人回答我的问题所以我希望可以问:
我收到以下错误:
Caused by: android.database.sqlite.SQLiteException: near "Group": syntax error (code 1): , while compiling: CREATE TABLE my_locations_table (_id INTEGER PRIMARY KEY, Name TEXT NOT NULL, Group TEXT NOT NULL, Lat TEXT NOT NULL, Lng TEXT NOT NULL);
#################################################################
Error Code : 1 (SQLITE_ERROR)
Caused By : SQL(query) error or missing database.
(near "Group": syntax error (code 1): , while compiling: CREATE TABLE my_locations_table (_id INTEGER PRIMARY KEY, Name TEXT NOT NULL, Group TEXT NOT NULL, Lat TEXT NOT NULL, Lng TEXT NOT NULL);)
这是我的代码:
private final static String KEY_ROWID = "_id";
private final static String KEY_NAME = "Name";
private final static String KEY_GROUP = "Group";
private final static String KEY_LAT = "Lat";
private final static String KEY_LNG = "Lng";
并且此时发生错误:
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("CREATE TABLE " + DATABASE_TABLE
+ " (" + KEY_ROWID + " INTEGER PRIMARY KEY, "
+ KEY_NAME + " TEXT NOT NULL, "
+ KEY_GROUP + " TEXT NOT NULL, "
+ KEY_LAT + " TEXT NOT NULL, "
+ KEY_LNG + " TEXT NOT NULL);");
}
现在看了几个小时后,我看不出这个问题了吗?