Re: Subquery to select max(date) value

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-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Subquery to select max(date) value
Date: 2019-02-12 22:29:14
Message-ID: CAKFQuwaW3oivY=6smmsBgF5-9qy-UC78WkOcxuyrYZd+bTgg5g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Feb 12, 2019 at 3:24 PM Rich Shepard <rshepard(at)appl-ecosys(dot)com> wrote:
> psql:next_contact_date.sql:7: ERROR: syntax error at or near "select"
> LINE 4: A.next_contact = select (max(A.next_contact) from A)
> ^
> and I fail to see what I've done incorrectly.

You put the open parenthesis after the word select instead of before.

A.next_contact = (SELECT max(A.next_contact) FROM A)

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rich Shepard 2019-02-12 22:32:59 Re: Subquery to select max(date) value [RESOLVED]
Previous Message Rich Shepard 2019-02-12 22:23:49 Subquery to select max(date) value