Re: Newbie: question on limiting number of records - Mailing list pgsql-general

From Colin Fox
Subject Re: Newbie: question on limiting number of records
Date
Msg-id pan.2002.02.26.15.46.14.760165.8309@crystalcherry.com
Whole thread Raw
List 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@crystalcherry.com

pgsql-general by date:

Previous
From: "Adam"
Date:
Subject: Re: setting up a trace through extended stored procedures
Next
From: a_asvin@mailcity.com (Asvin Ananthanarayan)
Date:
Subject: PostgreSQl or BerkeleyDB ??