Re: get certain # of recs

Stephan Szabo <sszabo@megazone23.bigpanda.com>

From: Stephan Szabo <sszabo@megazone23.bigpanda.com>
To: "Mike S. Nowostawsky" <mikenowo@sympatico.ca>
Cc: pgsql-general@postgresql.org
Date: 2001-09-14T22:26:08Z
Lists: pgsql-general
On Thu, 13 Sep 2001, Mike S. Nowostawsky wrote:

> How can one select only a certain number of records in Postgres?
> 
> In other SQL langs we can use, say, for the first 20 recs:
> 
> select  * from tablename where rownum < 21;
> 
> WHAT should 'rownum' be to make this select work... OR is there a diff
> syntax?

select * from tablename LIMIT 20;