Help retrieving lastest record - Mailing list pgsql-sql

From Steve Meynell
Subject Help retrieving lastest record
Date
Msg-id 3A8C4471.CFDF9937@candata.com
Whole thread Raw
Responses Re: Help retrieving lastest record
Re: Help retrieving lastest record
List pgsql-sql
Ok what I am trying to do is select out of the database the latest record meeting a certain criteria. <p>Example:
<p>Number            |        Fruit         |     Date <br />15                                Apples          July 20,
1999<br />20                                Oranges        June 7, 2000 <br />13                                
Pears           Jan 31, 2000 <br />17                                 Apples         April 10, 1999 <br />Now what I
needto do is select the oranges out because the date is the latest one, something like: <p>select * from basket where
max(date);<br />This would yield me: <br />20                                Oranges        June 7, 2000 <p>I know this
doesn'twork but I need something like it. <br />or something like <p>select * from basket where max(date) and
fruit='Apples';<br />This would yield me: <br />15                                Apples          July 20, 1999
<p>Thankyou in advance, <br />  <pre>-- 
 
Steve Meynell
Candata Systems</pre>  

pgsql-sql by date:

Previous
From: Steve Meynell
Date:
Subject: Help Retrieving Latest Record
Next
From: Alex Pilosov
Date:
Subject: Re: Help retrieving lastest record