selecting latest record

From: Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org>
To: pgsql-sql(at)postgresql(dot)org
Subject: selecting latest record
Date: 2009-09-22 09:44:57
Message-ID: 20090922094457.GA24885@apartia.fr
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I have a simple table

price(id_product, price, date)

which records price changes for each id_product. Each time a price
changes a new tuple is created.

What is the best way to select only the latest price of each id_product?

Thanks,

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2009-09-22 09:56:54 Re: selecting latest record
Previous Message Rob Sargent 2009-09-22 02:45:02 Re: Working slow