Re: Selecting table row with latest date - Mailing list pgsql-general

From Rich Shepard
Subject Re: Selecting table row with latest date
Date
Msg-id alpine.LNX.2.20.2108190741170.15165@salmo.appl-ecosys.com
Whole thread Raw
In response to Re: Selecting table row with latest date  ("David G. Johnston" <david.g.johnston@gmail.com>)
List 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 by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Selecting table row with latest date
Next
From: Rich Shepard
Date:
Subject: Re: Selecting table row with latest date