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

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

qml - Is it possible to implement SystemTrayIcon functionality in Qt Quick application -

double exclamation marks in haskell -