Re: Selecting table row with latest date

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Selecting table row with latest date
Date: 2021-08-19 14:42:57
Message-ID: 27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 8/19/21 7:37 AM, Rich Shepard wrote:
> I have a table of contacts (PK is the person_nbr and contact_date) and I
> want to select only the row with the latest (most recent) contact_date. The
> Comparison Date/Time sections in the postgres 12 doc doesn't appear to have
> what I want, and when I try to use the max() aggregate function it
> throws an
> error.

Show the query and the error you received.

>
> Please point me to the proper place in the docs where I can learn how to do
> this.
>
> Rich
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2021-08-19 14:45:58 Re: Selecting table row with latest date
Previous Message Tom Lane 2021-08-19 14:41:22 Re: Selecting table row with latest date