Search
 
SCRIPT & CODE EXAMPLE
 

SQL

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 :: postgresql change user role grant 
Sql :: mysql on duplicate key update get value from values 
Sql :: sql server default port 
Sql :: oracle sql generate list of days 
Sql :: sql online 
Sql :: sql inserted 
Sql :: postgres get number of days between two dates 
Sql :: convert dd/mm/yyyy to yyyy-mm-dd in sql server 
Sql :: check for directory in bash 
Sql :: uncheck constraints and delete from table 
Sql :: sql delete 
Sql :: postgres create multiple index 
Sql :: select odd records sql 
Sql :: postgresql remove duplicate rows 2 columns 
Sql :: SQL Error [42501]: ERROR: permission denied for table 
Sql :: mysql dump for selected row 
Sql :: how to insert a uniqueidentifier in sql 
Sql :: sql insert into select 
Sql :: Select with remove white spaces in sql 
Sql :: insert many to many sql 
Sql :: sql case statement 
Sql :: restore backup "text" postgresql command line 
Sql :: mysql 5.6 hierarchical recursive query 
Sql :: change password in mysql 
Sql :: what is cursor in sql server with example 
Sql :: sql left join with where clause 
Sql :: timestamp datatype in sql 
Sql :: mysql sql.gz 
Sql :: SQL get max per id 
Sql :: Rows, INSERT INTO, Returning 
ADD CONTENT
Topic
Content
Source link
Name
4+4 =