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 :: drop view in mysql 
Sql :: mysql server does not start mac 
Sql :: oracle search stored procedures for text 
Sql :: sql server check if temp table exists 
Sql :: oracle sql drop index 
Sql :: mysql modify foreign key 
Sql :: get size of indexes postgres 
Sql :: mysql add days to date 
Sql :: mysql get time from datetime 
Sql :: sql database size 
Sql :: how to get list of synonyms in oracle 
Sql :: drop a row in mysql 
Sql :: start mysql server 
Sql :: postgres restart id 
Sql :: sql check roles 
Sql :: oracle to date 
Sql :: import database in phpmyadmin command line 
Sql :: pip install mysqlclient error 
Sql :: sql drop multiple columns if exists 
Sql :: mysql delete last row 
Sql :: set username and password for postgresql database 
Sql :: sql server add identity column to existing table 
Sql :: sql command to find foreign key references 
Sql :: mysql bidirectional composite primary key 
Sql :: oracle source query 
Sql :: how to check nls format in oracle 
Sql :: sql server get type of column 
Sql :: sql count columns 
Sql :: sql sort column by date 
Sql :: Failed to connect to localhost:1433 - self signed certificate 
ADD CONTENT
Topic
Content
Source link
Name
6+7 =