How to read the last record in SQLite table? -
is there way read value of last record inserted in sqlite table without going through previous records ?
ask question performance reasons.
there function named sqlite3_last_insert_rowid() return integer key recent insert operation. http://www.sqlite.org/c3ref/last_insert_rowid.html
this helps if know last insert happened on table care about.
if need last row on table, regardless of wehter last insert on table or not, have use sql query
select * mytable rowid in ( select max( rowid ) mytable );
Comments
Post a Comment