Re: Subquery to select max(date) value

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: Subquery to select max(date) value
Date: 2019-02-12 22:58:42
Message-ID: 8b99480a-7711-694e-a1c5-ae65bb0c0364@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 2/12/19 2:48 PM, Rich Shepard wrote:
> On Tue, 12 Feb 2019, Rich Shepard wrote:
>
>>      A.next_contact = (select (max(A.next_contact)) from Activities as A)
>
> Errata:
>
> The parentheses around the max aggregate are not necessary.
>
> A.next_contact now displays at the end of each returned row as 'infinity'.

'infinity' is the max date, so this is what you want?

>
> Rich
>
>

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ken Tanzer 2019-02-12 22:59:16 Re: Subquery to select max(date) value
Previous Message Matt Zagrabelny 2019-02-12 22:55:01 Re: Subquery to select max(date) value