Re: Refining query statement

From: Rich Shepard <rshepard(at)appl-ecosys(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Refining query statement
Date: 2019-01-17 18:01:09
Message-ID: alpine.LNX.2.20.1901170958220.18965@salmo.appl-ecosys.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 17 Jan 2019, Adrian Klaver wrote:

> Seems to me a boolean field of name active to denote contacts you need to
> keep up with is in order. Then make the next_contact field NOT NULL and
> replace the current NULL values with 'infinity':

> WHERE COALESCE(next_contact, 'infinity') BETWEEN '01/01/2019'::date AND
> 'today'::date

Adrian,

Having added a new column, 'active' with boolean values (and a default of
true), would this WHERE clause work:

WHERE active = TRUE and next_contact <= 'today'::date

?

Regards,

Rich

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message AI Rumman 2019-01-17 18:01:52 Re: Postgres Automated Failover
Previous Message Rich Shepard 2019-01-17 17:37:46 Re: Refining query statement