Sql – How to limit rows in PostgreSQL SELECT

postgresqlsqlsql-limit

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

Best Solution

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

SELECT * FROM users LIMIT 5;