Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql limit rows

-- MySql
SELECT * FROM emp ORDER BY sal DESC LIMIT 5;	
-- SQL Server 
SELECT TOP 5 * FROM emp ORDER BY sal DESC;	
-- Oracle < 11g 
SELECT * FROM ( SELECT * FROM emp ORDER BY sal DESC ) WHERE ROWNUM <= 5;
-- Oracle 12c +
SELECT * FROM emp ORDER BY sal DESC FETCH FIRST 5 ROWS ONLY;	
Comment

PREVIOUS NEXT
Code Example
Sql :: how to get nearest location in mysql with latitude and longitude 
Sql :: (PDOException(code: 2002): SQLSTATE[HY000] [2002] Permission denied at 
Sql :: sql date get month 
Sql :: select row from mysql where date more than 30 days 
Sql :: pluck in query builder 
Sql :: sql server update to null 
Sql :: mysql insert value date 
Sql :: oracle drop temporary table 
Sql :: SQL Auto Increment Primary Key - SQL Server 
Sql :: update with inner join postgres 
Sql :: snowflake datetrunc month 
Sql :: mysql separator 
Sql :: lowest salary in sql 
Sql :: declare variables sql 
Sql :: sql mm/dd/yyyy format 
Sql :: oracle create table if not exists 
Sql :: phpmyadmin change password 
Sql :: syntaxerror unexpected identifier mysql 
Sql :: drop multiple columns in sql 
Sql :: alter table add multiple foreign key sql 
Sql :: postgres show databases 
Sql :: SELECT exists sql 
Sql :: show all event schedular on mysql 
Sql :: drop primary key oracle 
Sql :: create table split string function in sql server 
Sql :: postgresql concatenate multiple rows into one row 
Sql :: desc in sql 
Sql :: sql convert datetime to year 
Sql :: 3rd highest value in sql 
Sql :: if in mysql 
ADD CONTENT
Topic
Content
Source link
Name
8+5 =