Comparisons Involving NULLs

We pointed out in Chapter 3 that because NULLs represent the unknown, you cannot determine whether a NULL exactly matches any other value, even another NULL.

For example, the advance for the book called Net Etiquette is represented as NULL. Does this mean that it is larger than $5,000? Smaller than $5,000? Is it larger or smaller than the advance for The Psychology of Computer Cooking, also represented as NULL?

Based on the definition of NULL as unknown, of course, the answer to all these questions is unknown. You might also say that the answer is “maybe.” That's what we mean when we say that NULL implies three-valued logic instead of the more intuitively understandable two-valued logic. With NULLs, the possibilities ...

Get Practical SQL Handbook, The: Using SQL Variants, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.