Skip site navigation (1) Skip section navigation (2)

Re: only the last 3 records

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: only the last 3 records
Date: 2008-09-27 07:23:01
Message-ID: 20080927072301.GA18008@a-kretschmer.de (view raw or flat)
Thread:
Lists: pgsql-general
am  Sat, dem 27.09.2008, um  9:13:48 +0200 mailte Alain Roger folgendes:
> Hi,
> 
> maybe it's a stupid question, but i do not remember how to query a table and to
> request only the latest 3 added records.
> How can i do that (i have a field time and a field date) ?

... order by <this field> desc limit 3;


Regards, Andreas
-- 
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

In response to

pgsql-general by date

Next:From: Andrew DunstanDate: 2008-09-27 15:05:21
Subject: Re: PostgreSQL future ideas
Previous:From: Alain RogerDate: 2008-09-27 07:13:48
Subject: only the last 3 records

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group