simple query question: return latest

Поиск
Список
Период
Сортировка
От Scott Frankel
Тема simple query question: return latest
Дата
Msg-id 490BA794-3446-11D9-B6EE-000A95A7B782@pacbell.net
обсуждение исходный текст
Ответы Re: simple query question: return latest  (Michael Glaesemann <grzm@myrealbox.com>)
Re: simple query question: return latest  (Michael Fuhr <mike@fuhr.org>)
Список 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 по дате отправления:

Предыдущее
От: Kyle
Дата:
Сообщение: Want to help on open-source ERP?
Следующее
От: Michael Glaesemann
Дата:
Сообщение: Re: simple query question: return latest