Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql get last row

SELECT fields FROM table ORDER BY id DESC LIMIT 1;
Comment

mysql select last 10 rows

SELECT * FROM tableName ORDER BY col1 DESC LIMIT 10;
Comment

select last row mysql

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 :: sql string starts with 
Sql :: get date from timestamp in mysql 
Sql :: oracle sql group by date year 
Sql :: size of all tables in a schema oracle 
Sql :: add user mysql 
Sql :: SQl Server Versionen Releases und Build-Nummern 
Sql :: mysql to lowercase 
Sql :: sql like query 
Sql :: mysqli_real_connect(): The server requested authentication method unknown to the client [caching_sha2_password] 
Sql :: sql select data from last week 
Sql :: sql to char function with date 
Sql :: where not in array sql 
Sql :: MySQL FIND_IN_SET() 
Sql :: job for postgresql.service failed because the control process exited with error code. see "systemctl status postgresql.service" and "journalctl -xe" for details. 
Sql :: get day in sql 
Sql :: mysql update table from another table 
Sql :: sql server week number 
Sql :: oracle pl sql source 
Sql :: mysql grant grant option 
Sql :: mysql timestamp to date 
Sql :: update single sql column 
Sql :: sql server: difference between hashtable and table declared using declare keyword 
Sql :: oracle auto increment primary key 
Sql :: show constraints mysql 
Sql :: give a column name to values generated from case statement in sql 
Sql :: mac install mysql 
Sql :: oracle insert into 
Sql :: find lowest number in sql 
Sql :: define a variable in mysql from select 
Sql :: insert current date sql 
ADD CONTENT
Topic
Content
Source link
Name
2+3 =