I'm reading over a query that performs a left outer join on itself with several on clauses. One of the on clauses is like so:
gl1.COLUMN1 IS NOT DISTINCT FROM gl2.COLUMN1
How is this different from saying
on gl1.COLUMN1=gl2.COLUMN1
I'm reading over a query that performs a left outer join on itself with several on clauses. One of the on clauses is like so:
gl1.COLUMN1 IS NOT DISTINCT FROM gl2.COLUMN1
How is this different from saying
on gl1.COLUMN1=gl2.COLUMN1
IS NOT DISTINCT FROM will also return true if gl1.COLUMN1 and gl2.COLUMN2 are both null
select 'a' = 'a'
--true
select null = null
--null
select 'a' is not distinct from 'a'
--true
select null is not distinct from null
--true