1#Where the the column name is "ID" and table name is "tablename" and ID naming is increasing numerical value.
2SELECT *
3FROM tablename
4WHERE ID = (
5 SELECT MAX(ID)
6 FROM Table)
1SELECT
2 (SELECT * FROM tableName ORDER BY col1 LIMIT 1) AS first,
3 (SELECT * FROM tableName ORDER BY col1 DESC LIMIT 1) AS last
4;