Dan Mertz Dan Mertz - 6 months ago 17
SQL Question

How to limit rows in PostgreSQL SELECT

What's the equivalent to SQL Server's TOP or DB2's FETCH FIRST or mySQL's LIMIT in PostgreSQL ?

Answer

You can use LIMIT just like in MySQL, for example:

SELECT * FROM users LIMIT 5;