You can use limit
in your query which will return the n
(n
is the number of the row you want to fetch) row.
String selectQuery = "SELECT * FROM " + COMPANY + " ORDER BY (" + KEY_CREATED_AT + ") DESC LIMIT 3 " ;
3
solved How to get recent added three data FROM SQLite