simple query question: return latest - Mailing list pgsql-general

From Scott Frankel
Subject simple query question: return latest
Date
Msg-id 490BA794-3446-11D9-B6EE-000A95A7B782@pacbell.net
Whole thread Raw
Responses Re: simple query question: return latest
Re: simple query question: return latest
List 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


pgsql-general by date:

Previous
From: Kyle
Date:
Subject: Want to help on open-source ERP?
Next
From: Michael Glaesemann
Date:
Subject: Re: simple query question: return latest