SQL Question - Mailing list pgsql-general

From Alex
Subject SQL Question
Date
Msg-id 425FAC67.2050203@meerkatsoft.com
Whole thread Raw
Responses Re: SQL Question
Re: SQL Question
List pgsql-general
Hi,

i have a table

ProdId | LastUpdate
-------+------------
100    | 2005-04-01
100    | 2005-03-01
100    | 2005-02-01
200    | 2005-04-01
200    | 2005-03-01
200    | 2005-02-01

- How can i select only the newest record for each ProdId ?

100    | 2005-04-01
200    | 2005-04-01

- How can i select to retrieve the last 2 dates in record

100    | 2005-04-01 | 2005-03-01
200    | 2005-04-01 | 2005-03-01


Thanks
Alex



pgsql-general by date:

Previous
From: George Hademenos
Date:
Subject: connection or database saving problem with glom (Msg-ID: resent-<20050415013227.P5287@ganymede.hub.org>)
Next
From: "Alejandro D. Burne"
Date:
Subject: If statements on select