Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql select last id

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: #sql #select #id
ADD COMMENT
Topic
Name
1+1 =