Please how can I retrieve the last on an Android DB? I'm using the Sugar ORM library to abstract all db operation but I can't seem to be able to figure out how to retrieve the oldest record on the db.
You have to order by some timestamp, if you have it, or by the ID, if it is autoincrementing, and take only the first result:
Thing.find(Thing.class, null, null, null, "timestamp DESC", "1");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With