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



---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org

Reply via email to