Question : sql select last id
Answered by : kwams-ahortor
#Where the the column name is "ID" and table name is "tablename" and ID naming is increasing numerical value.
SELECT *
FROM tablename
WHERE ID = ( SELECT MAX(ID) FROM Table)
Source : | Last Update : Thu, 05 Aug 21
Question : sql get last ID
Answered by : oldfashioned-oystercatcher-oo9up7x1w84s
SELECT MAX(id) FROM <tablename>
Source : | Last Update : Fri, 28 May 21
Question : sql select last id
Answered by : vastemonde
SELECT (SELECT * FROM tableName ORDER BY col1 LIMIT 1) AS first, (SELECT * FROM tableName ORDER BY col1 DESC LIMIT 1) AS last
;
Source : https://stackoverflow.com/questions/1485391/how-to-get-first-and-last-record-from-a-sql-query | Last Update : Tue, 27 Apr 21