2

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
mustaccio
  • 18,234
  • 16
  • 48
  • 57
Serge
  • 608
  • 4
  • 12
  • 24
  • Consider [the manual](http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/topic/com.ibm.db2z10.doc.sqlref/src/tpc/db2z_distinctpredicate.htm) – mustaccio May 09 '14 at 00:49

1 Answers1

4

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
FuzzyTree
  • 32,014
  • 3
  • 54
  • 85