sqliteにはAUTOINCREMENT制約がないので、やりたいのにやれないなー と思っていたが、 http://www.sqlite.org/faq.html#q1 を見るとなんとできるらしい。こうやる。 sqlite> create table test (a INTEGER PRIMARY KEY,b); sqlite> insert into test values(NULL,'hoge'); sqlite> select * from test; 1|hoge sqlite> insert into test (b) values ('ahoge'); sqlite> select * from test; 1|hoge 2|ahogeINTEGER および PRIMARY KEYに指定した値にNULLをinsertすると、AUTOINCREMENTと同じ処理になるようだ。 2