Re: Selecting table row with latest date

Поиск
Список
Период
Сортировка
От Rich Shepard
Тема Re: Selecting table row with latest date
Дата
Msg-id alpine.LNX.2.20.2108190741170.15165@salmo.appl-ecosys.com
обсуждение исходный текст
Ответ на Re: Selecting table row with latest date  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Thu, 19 Aug 2021, David G. Johnston wrote:

> Select distinct on (person_nbr) ….. order by person_nbr, contact_date
> desc;

David,

Please clarify: would this produce the most recent contact_date for each
person_nbr? The manual reads that two rows (e.g., for the same person_nbr)
are considered distinct if they differ in any one column (e.g.,
contact_dates).

Still confused.

Rich




В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Selecting table row with latest date
Следующее
От: Rich Shepard
Дата:
Сообщение: Re: Selecting table row with latest date