select first and last row sql

Solutions on MaxInterview for select first and last row sql by the best coders in the world

showing results for - "select first and last row sql"
Erica
09 Jun 2019
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;