AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY - android

后端 未结 3 1971
终归单人心
终归单人心 2020-12-10 13:00

I\'m trying to create a table in my DB with an ID that is autoincrement itself but whenever I try to add the AUTOINCREMENT keyword to my query it tells me that :

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 13:36

    Create Table like this put some space before INTEGER ....

    "CREATE TABLE "+TABLE_NAME+" ("+KEY_ID+" INTEGER PRIMARY KEY AUTOINCREMENT)";
    

提交回复
热议问题