在插入語句的後面添加一條語句:select last_insert_rowid();便可返回剛剛插入行的主鍵值。sql
insert into Diary (Task,Content) values ('xxx','xxx'); select last_insert_rowid();
在插入語句的後面添加一條語句:select last_insert_rowid();便可返回剛剛插入行的主鍵值。sql
insert into Diary (Task,Content) values ('xxx','xxx'); select last_insert_rowid();