DeveloperBreeze

SQL: How to Select Top N Records

sql
-- For SQL Server
SELECT TOP 10 * FROM Customers;

-- For MySQL and PostgreSQL
SELECT * FROM Customers LIMIT 10;

-- For Oracle
SELECT * FROM (SELECT * FROM Customers) WHERE ROWNUM <= 10;

Continue Reading

Handpicked posts just for you — based on your current read.

Discussion 0

Please sign in to join the discussion.

No comments yet. Start the discussion!