Hello! SQL actually has three boolean values: TRUE, FALSE, and UNKNOWN (UNKNOWN in the same thing as NULL). Comparison operators can return all these values. NULL is neither equal nor not equal to NULL or any other value, results of all six comparison operators (=, <>, <, >, <=, >=) return UNKNOWN if either operand is null (and in some other cases), they don't return FALSE here.
Distinct predicate is different, it always returns TRUE or FALSE, even when comparison operation between operands cannot determine their equality or not equality. In this predicate NULL is not distinct from other NULL. Equal values are not distinct from each other. Non-equal values are distinct from each other and from NULL. IS NOT DISTINCT FROM is a null-safe equivalent of =, IS DISTINCT FROM is a null-safe equivalent of <>. Various filtration clauses (WHERE, HAVING, etc.) preserve rows where expression evaluates to TRUE only. CHECK and domain constraints allow rows / values where expression evaluates to TRUE or UNKNOWN. -- You received this message because you are subscribed to the Google Groups "H2 Database" group. To unsubscribe from this group and stop receiving emails from it, send an email to h2-database+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/h2-database/dbc36bc6-feb5-4feb-bb93-4f2c9429460fn%40googlegroups.com.