pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: selecting latest record
Date: Tue, 22 Sep 2009 11:44:57 +0200
Message-ID: <20090922094457.GA24885@apartia.fr> (raw)

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,



view thread (5+ messages)  latest in thread

Message-ID: <20090922094457.GA24885@apartia.fr>
Permalink:  ../20090922094457.GA24885@apartia.fr/
Also on:    postgresql.org/message-id/20090922094457.GA24885@apartia.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vindex+lists-pgsql-sql@apartia.org
  Subject: Re: selecting latest record
  In-Reply-To: <20090922094457.GA24885@apartia.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox