Received: from sss.pgh.pa.us (sss.pgh.pa.us [209.114.132.154]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f1GL13x63593 for ; Fri, 16 Feb 2001 16:01:03 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.11.1/8.11.1) with ESMTP id f1GL0v913703; Fri, 16 Feb 2001 16:00:57 -0500 (EST) To: Steve Meynell cc: Postgresql Mailing List Subject: Re: Help Retrieving Latest Record In-reply-to: <3A8D3C04.3D81B5BA@candata.com> References: <3A8D3C04.3D81B5BA@candata.com> Comments: In-reply-to Steve Meynell message dated "Fri, 16 Feb 2001 09:41:09 -0500" Date: Fri, 16 Feb 2001 16:00:56 -0500 Message-ID: <13700.982357256@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200102/294 X-Sequence-Number: 1488 Steve Meynell writes: > select * from basket where max(date) and fruit='Apples'; > I know this doesn't work but I need something like it. Perhaps select * from basket where fruit='Apples' order by date desc limit 1; The limit clause is not standard SQL, but it's a pretty easy answer if portability doesn't bother you... regards, tom lane