Re: get certain # of recs

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: "Mike S(dot) Nowostawsky" <mikenowo(at)sympatico(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: get certain # of recs
Date: 2001-09-14 22:26:08
Message-ID: Pine.BSF.4.21.0109141525430.43854-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
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;

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2001-09-14 22:29:11 Re: Postgresql data backup
Previous Message Stephan Szabo 2001-09-14 22:25:17 Re: joinning tables