simple query question: return latest

From: Scott Frankel <leknarf(at)pacbell(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: simple query question: return latest
Date: 2004-11-12 01:00:46
Message-ID: 490BA794-3446-11D9-B6EE-000A95A7B782@pacbell.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Still too new to SQL to have run across this yet ...

How does one return the latest row from a table, given multiple entries
of varying data?
i.e.: given a table that looks like this:

color | date
--------+------------
red | 2004-01-19
blue | 2004-05-24
red | 2004-04-12
blue | 2004-05-24

How do I select the most recent entry for 'red'?

Thanks in advance!
Scott

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Glaesemann 2004-11-12 01:09:44 Re: simple query question: return latest
Previous Message Kyle 2004-11-12 00:53:46 Want to help on open-source ERP?