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

html - jquery - p element wont show after I hid it -

python - BeautifulSoup: How to get the nearest tag -

mysql - Trying to get RmySQL to work but not understanding bash's export or filesystem conventions -