only the last 3 records

Started by Alain Rogerover 17 years ago2 messagesgeneral
Jump to latest
#1Alain Roger
raf.news@gmail.com

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) ?

thx.

--
Alain
------------------------------------
Windows XP SP3
PostgreSQL 8.2.4 / MS SQL server 2005
Apache 2.2.4
PHP 5.2.4
C# 2005-2008

#2A. Kretschmer
andreas.kretschmer@schollglas.com
In reply to: Alain Roger (#1)
Re: only the last 3 records

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