Re: Selecting table row with latest date

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
Cc: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Selecting table row with latest date
Date: 2021-08-19 14:40:19
Message-ID: CAKFQuwb0S+PG=BoALF5yD-0GkthB7adq27P0hzH8QQTW-sEOQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday, August 19, 2021, Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:

> I have a table of contacts (PK is the person_nbr and contact_date)
>

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

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2021-08-19 14:41:06 Re: Selecting table row with latest date
Previous Message Rich Shepard 2021-08-19 14:37:27 Selecting table row with latest date