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

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

get last 50 rows sql

select * from tbl_name order by id desc limit N;
Comment

PREVIOUS NEXT
Code Example
Sql :: import sql dump into postgresql database 
Sql :: mysql regexp match word 
Sql :: postgresql get connection string 
Sql :: sql server add time to date 
Sql :: list all tables in postgres 
Sql :: join multiple tables sql 
Sql :: row to value to json in sql server 
Sql :: inner join distinct 
Sql :: how to combine 2 tables in mysql 
Sql :: SQL Server Altering Column to be Unique 
Sql :: database timezone 
Sql :: mysqlclient error 
Sql :: SQL query to verify the size of the table 
Sql :: query by column for substring sql 
Sql :: oracle list proxy users 
Sql :: How do I insert a blob in SQL? 
Sql :: SQL Multi-line Comments 
Sql :: how to display value of variable in mysql 
Sql :: mysql utc to local time 
Sql :: postgresql full text search 
Sql :: sql convert datetime 
Sql :: sql greater than 
Sql :: into sql 
Sql :: sql delete duplicate rows 
Sql :: postgres default value 
Sql :: query to delete a database in mysql 
Sql :: oracle right characters 
Sql :: postgres create database if not exists 
Sql :: if null put 0 sql 
Sql :: how to get all dates in a month in oracle 
ADD CONTENT
Topic
Content
Source link
Name
7+1 =