On the Wikipedia page for SQL there are some truth tables about boolean logic in SQL. [1] The Wikipedia page seems to source the SQL:2003 standard.
The truth table for the equals operator (=) is different from the IS operator from the SQL:2003 draft.
Also, the Wikipedia article notes that "IS NULL" (<null predicate>) is a special case.
In the SQL:2003 it seems that there is an "IS" opeartor which is a regular operator like AND, NOT and OR. However, the <null predicate> is still there.
Why is the <null predicate> there when the IS is a regular boolean operator? Is it to make sure you can use the "IS NULL" construct with non-boolean values without type coersion? Is it discouraged to use "=NULL"?
Does the SQL:2011 standard work differently?
[1]: Wikipedia on SQL
[2]: SQL:2011 draft PDF page 335
[3]: SQL:2003 draft PDF page 397
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…