Null is a special value that represents an unknown value. Any arithmatic operation (+,-,*, /) that has at least one Null operand results in Null. The same thing applies with comparisons: All comparisons with Null would result in Null. Even Null = Null returns Null. Therefore,
andoperator:true and Nullresults inNullfalse and Nullresults infalseNull and Nullresults inNull
oroperator:true or Nullresults intruefalse or Nullresults inNullNull or Nullresults inNull
notoperator:not Nullresults inNull
- To test if a value is
Null, useIS NULLorIS NOT NULL - In
whereclause, recods that evaluates to eitherfalseorNullare excluded - Aggregation functions such as
sumandaveragediscardNullrecords count(*)returns the number of records in a table. Butcount(field)returns the number of notNullrecords in the table. This means if the field is empty (Nullvalues only),count(field)will return zero.