Re: How to compare dates from two tables with blanks values - Mailing list pgsql-general

From Mike Martin
Subject Re: How to compare dates from two tables with blanks values
Date
Msg-id CAOwYNKb0C_8QmcjhmpP+LOWWo9j_dM6OQebEOk9_xR6a7an1FQ@mail.gmail.com
Whole thread Raw
In response to Re: How to compare dates from two tables with blanks values  ("Arnaud L." <arnaud.listes@codata.eu>)
List pgsql-general
thanks for this. I did get it to work using coalesce and nullif on opposite sides of the where condition, but the IS DISTINCT FROM certainly sounds a better approach. Coming from SQLServer until last year , never came across it before

Mike

On Wed, 19 Dec 2018 at 10:57, Arnaud L. <arnaud.listes@codata.eu> wrote:
Le 19/12/2018 à 11:41, Mike Martin a écrit :
> cast(nullif(d.joineddate,NULL) as timestamp) != cast(nullif(s.joineddate,'') as timestamp)
Try with
d.joineddate IS DISTINCT FROM s.joineddate

https://www.postgresql.org/docs/current/functions-comparison.html

Cheers
--
Arnaud

pgsql-general by date:

Previous
From: Rijo Roy
Date:
Subject: Re: Wals not recycling
Next
From: "Kumar, Virendra"
Date:
Subject: RE: Multiple LDAP Servers for ldap Authentication