Create table t 1 (
Integer primary key,
B integer
);
It is pointed out in the data sheet
Insert t 1 value (NULL,123);
Logically equivalent to:
Insert the value of t 1 (choose max(a)+ 1,123 from t 1);
A new API function sqlite3_last_insert_rowid () returns the plastic key of the latest insert operation.
Note that this integer key is always larger than the last key inserted in the table before 1. The new key is unique relative to the existing key in the table, but it may overlap with the key value previously deleted from the table. To always get a unique key in the whole table, add the keyword AUTOINCREMENT before declaring the integer primary key. In this way, the selected key will always be larger than the existing largest key in the table 1. If the largest possible key already exists in the table, the insert operation will fail and an SQLITE_FULL error code will be returned.