Re: Newbie: question on limiting number of records

From: Colin Fox <cfox(at)crystalcherry(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Newbie: question on limiting number of records
Date: 2002-02-26 23:47:28
Message-ID: pan.2002.02.26.15.46.14.760165.8309@crystalcherry.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 08 Feb 2002 10:33:22 -0800, G.W. Lucas wrote:

<..>
>
> I would like to perform a query and obtain a result something like the
> following:
>
> for all names
> show latest three records (or fewer, if 3 not available)

Look into the 'limit' keyword:

select * from people order by id limit 10;

will return the first 10 entries in the people table.

--
Colin Fox
CF Consulting Inc.
cfox(at)crystalcherry(dot)com

Browse pgsql-general by date

  From Date Subject
Next Message Dominic J. Eidson 2002-02-27 00:04:09 Re: configure --with-pam
Previous Message Helge Bahmann 2002-02-26 23:41:36 Re: configure --with-pam