pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Rich Shepard <rshepard@appl-ecosys.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Selecting table row with latest date
Date: Thu, 19 Aug 2021 07:42:57 -0700
Message-ID: <27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com> (raw)
In-Reply-To: <alpine.LNX.2.20.2108190730510.15165@salmo.appl-ecosys.com>
References: <alpine.LNX.2.20.2108190730510.15165@salmo.appl-ecosys.com>

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.klaver@aklaver.com





view thread (23+ messages)  latest in thread

Message-ID: <27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com>
Permalink:  ../27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com/
Also on:    postgresql.org/message-id/27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, rshepard@appl-ecosys.com
  Subject: Re: Selecting table row with latest date
  In-Reply-To: <27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com>
  References: <alpine.LNX.2.20.2108190730510.15165@salmo.appl-ecosys.com> <27de6c2f-4c60-5985-9b1e-469ae633ca1c@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox