Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get last/Bottom row of the table in Sqlite via Sql Query

Tags:

sql

sqlite

iphone

I am trying to fetch the last row of my sqlite3 db. can anybody tell me the query syntax.

like image 445
Nitesh Avatar asked Sep 18 '25 20:09

Nitesh


1 Answers

SELECT field
FROM TABLE
ORDER BY field DESC
LIMIT 1

assuming that ordering by DESC puts your last row first

like image 185
Joseph Victor Zammit Avatar answered Sep 20 '25 11:09

Joseph Victor Zammit