Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

select first and last row sql

SELECT
  (SELECT * FROM tableName ORDER BY col1 LIMIT 1)        AS first,
  (SELECT * FROM tableName ORDER BY col1 DESC LIMIT 1)   AS last
;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #row #sql
ADD COMMENT
Topic
Name
7+8 =