next up previous
Next: Nested Subqueries Up: SQL Previous: Aggregate Functions

Null Values

  1. With insertions, we saw how null values might be needed if values were unknown. Queries involving nulls pose problems.
  2. If a value is not known, it cannot be compared or be used as part of an aggregate function.
  3. All comparisons involving null are false by definition. However, we can use the keyword null to test for null values:

     select distinct loan#

    from loan

    where amount is null

  4. All aggregate functions except count ignore tuples with null values on the argument attributes.

Osmar Zaiane
Fri May 22 19:39:12 PDT 1998