Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql limit order by

-- 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 :: timestamp sql 
Sql :: what is denormalization in sql 
Sql :: how to get table id sequence postgres 
Sql :: postgres full text search example 
Sql :: mysql replace regex 
Sql :: SQL IS NULL With COUNT() 
Sql :: wamp server mysql password 
Sql :: convert negative to positive in sql 
Sql :: oracle sql developer 
Sql :: sqlite clear shell 
Sql :: sql numeric data type 
Sql :: oracle cpu metric 
Sql :: generate series sybase 
Sql :: union syntax in oracle 
Sql :: how to rename column name in sql server using query 
Sql :: date datatype in livesql 
Sql :: Get a list of tables and the primary key 
Sql :: sql server size of every table in a db 
Sql :: oracle disk group space 
Sql :: SQL:RANK function to delete duplicate rows 
Sql :: postgresql array to rows 
Sql :: postgresql populate data random 
Sql :: how to insert same table data using mysql query 
Sql :: how to find columns with null values in sql 
Sql :: query to get all primary keys and foreign key 
Sql :: timestamp to date sql server 
Sql :: oracle swap partition 
Sql :: hour differeence in mysql 
Sql :: find max number in sql 
Sql :: SQL SMALLDATETIME Data Type 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =