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

How to read the last row with SQL Server

SELECT TOP 1 * FROM table_Name ORDER BY unique_column DESC
Comment

PREVIOUS NEXT
Code Example
Sql :: grant lock tables privilege mysql 
Sql :: sqlite connection string 
Sql :: postgres select from last 3 months 
Sql :: append column sql 
Sql :: mysql text type max length 
Sql :: MySQL - Enabling the Event Scheduler 
Sql :: generate c# class from sql server table 
Sql :: psql list rules 
Sql :: mariadb show tables 
Sql :: second last highest id in sql 
Sql :: stop psql server windows 
Sql :: get table column names sql ssms 
Sql :: mysql format date 
Sql :: oracle delete last row 
Sql :: mysql get first 2 characters of string 
Sql :: how to check database size in mysql 
Sql :: console output pl sql 
Sql :: altering the column name in MySQL to have a default value 
Sql :: O SGBD MySQL utiliza um schema próprio para o armazenamento das tabelas que compõem o dicionário de dados. Marque a alternativa que indica o nome do s 
Sql :: oracle show trigger code 
Sql :: laravel to sql 
Sql :: apex select list ORA-20999 
Sql :: mysql user permission database 
Sql :: tsql rename table 
Sql :: mysql show tables in database 
Sql :: mysql drop trigger 
Sql :: postgres add superuser to database 
Sql :: if then else sqlite 
Sql :: SQL query to convert DD/MM/YYYY to YYYY-MM-DD 
Sql :: oracle substring 
ADD CONTENT
Topic
Content
Source link
Name
9+3 =