#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
;