Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get last row of table in sql

mysql> select *from getLastRecord ORDER BY id DESC LIMIT 1;
Comment

select last row in sql

SELECT TOP 1 * FROM Table ORDER BY ID DESC
Comment

get last record in sql

SELECT * FROM TableName WHERE id=(SELECT max(id) FROM TableName);
Comment

Select last row from SQL Table

SELECT * FROM TableName WHERE id=(SELECT max(id) FROM TableName);
Comment

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
;
Comment

PREVIOUS NEXT
Code Example
Sql :: sqlite drop table 
Sql :: postgres list all stored procedures query 
Sql :: sql select where in list 
Sql :: sql order by case 
Sql :: how to remove a column from a table in MySQL 
Sql :: mysql procedures 
Sql :: replace all numbers in mysql 
Sql :: how to know the username of postgresql 
Sql :: sql where keyword contains 
Sql :: allsource oracle 
Sql :: ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails 
Sql :: create index concurrently postgres 
Sql :: concate update mysq 
Sql :: begin transaction in sql 
Sql :: mysql add to number 
Sql :: random name function in mysql for nvarchar 
Sql :: postgres add column integer 
Sql :: mysql ifnull 
Sql :: foreign key mysql 
Sql :: pluck in query builder 
Sql :: is between inclusive or exclusive sql 
Sql :: convert money to varchar sql server 
Sql :: mysql subdate 
Sql :: select count 
Sql :: mysql update with subquery 
Sql :: phpmyadmin change password 
Sql :: mysql clear screen 
Sql :: oracle select first row order by 
Sql :: mysql search table in all databases 
Sql :: referential integrity constraint 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =