android - Retrieving last inserted 'n' rows from a table -


i want retrieve last inserted 'n' number of rows sqlite table. used below query i'm getting error, please me correct query. if query wrong please suggest me better query:

public cursor readlastndetails(int n) {     return this.data.rawquery("select top ("+n+") name,place,occupation,date  tb_employee order id desc", null); } 

use following query,

"select name,place,occupation,date    tb_employee   order id   desc limit"+ n 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

qt - Errors in generated MOC files for QT5 from cmake -