I have a table, with autoincremented id
CREATETABLEusers (
idSERIALNOTNULL,
nameVARCHAR(30) NOTNULL,
PRIMARY KEY (id)
)I can add a new item there with an explicit id
INSERTINTOusers (id, name) VALUES (2, 'fred')And while my id is autoincremented, I can omit it
INSERTINTOusers (name) VALUES ('ed')So, this time, I don't know the id, and I want to somehow get it.
I could do it with LAST_IDENTITY() function, but it just uses %RowID, and have no relation to the primary id