#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)
SELECT MAX(id) FROM <tablename>
SELECT
(SELECT * FROM tableName ORDER BY col1 LIMIT 1) AS first,
(SELECT * FROM tableName ORDER BY col1 DESC LIMIT 1) AS last
;
Select Distinct names.xyz
From nameList names
LEFT JOIN nameList idNum
ON idNum.xyz > names.xyz AND idNum.xyz IS NOT NULL
WHERE idNum.xyz IS NULL