Get the records with the largest IDs first, then stop after the first record:
SELECT * FROM MyTable ORDER BY id DESC LIMIT 1
Just like the mysql, you can use MAX()
MAX()
e.g. SELECT MAX(id) AS member_id, name, value FROM YOUR_TABLE_NAME
SELECT MAX(id) AS member_id, name, value FROM YOUR_TABLE_NAME
If you want to know the query syntax :
String query = "SELECT MAX(id) AS max_id FROM mytable";