SQLite autoincrement - How to insert values?

前端 未结 4 1159
悲哀的现实
悲哀的现实 2020-12-03 00:21

I generate a SQLite table (in java):

create table participants (ROWID INTEGER PRIMARY KEY AUTOINCREMENT, col1,col2);

afterwards I try to a

4条回答
  •  难免孤独
    2020-12-03 01:03

    Easiest way without using column names will be using null in the place of autoincreament is like this

    insert into table values (null, col1, col2)
    

    if you have already set the first column as autoincrement, it will work fine.

提交回复
热议问题