Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

select last row in 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
6+5 =