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;
1 Select Distinct names.xyz
2 From nameList names
3 LEFT JOIN nameList idNum
4 ON idNum.xyz > names.xyz AND idNum.xyz IS NOT NULL
5 WHERE idNum.xyz IS NULL
6