I want to get the value of a column and the value must be the last record of a table, I ve searched in online and I didnt get one using Room
database can any one help me to get the query for that.
this is my table constructor
public ItemTable(String itemid, String itemname, String itemdesc, String imageurl, String price, String timestamp) {
this.itemid = itemid;
this.itemname = itemname;
this.itemdesc = itemdesc;
this.imageurl = imageurl;
this.price = price;
this.timestamp = timestamp;
}
I want timestamp of last inserted record, how can I get it? what is the query to achieve that
you can use this query.
SELECT * FROM ItemTable ORDER BY timestamp DESC LIMIT 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