SQL Server
SELECT * FROM t WHERE note = '' OR note IS NULL;
'' and NULL are distinct values, so a column that allows both needs both checks, unless a NOT NULL or CHECK (note <> '') constraint rules one out.
In Oracle, '' IS NULL is true. Everywhere else it is false. That one fact rewrites your WHERE clauses.
Filed under Types & casting
The same SQL is right on four engines and redundant on the fifth. A bare IS NULL check is complete on Oracle but misses '' rows everywhere else; NULLIF(note, '') IS NULL catches both cases on all five.
For the four engines the empty string and NULL are different values, and both checks are needed when text columns can hold either. Oracle makes the distinction impossible to express because zero-length text simply is NULL.
SELECT * FROM t WHERE note = '' OR note IS NULL;
'' and NULL are distinct values, so a column that allows both needs both checks, unless a NOT NULL or CHECK (note <> '') constraint rules one out.
SELECT * FROM t WHERE note = '' OR note IS NULL;
Distinct values, as ANSI intends. IS NOT DISTINCT FROM compares them without the three-valued-logic trap.
SELECT * FROM t WHERE note = '' OR note IS NULL;
Distinct values. Note that NULL fails both = '' and <> '' comparisons.
SELECT * FROM t WHERE note = '' OR note IS NULL;
Distinct values. In ascending order NULL sorts first, then '', then 'a'.
SELECT * FROM t WHERE note IS NULL;
'' IS NULL evaluates to true: Oracle treats zero-length character values as NULL, so you cannot store an empty string in a column at all.
A long-standing implementation choice, documented and never changed because real code depends on it. VARCHAR2 columns cannot distinguish empty from missing.
Collapse '' to NULL first (UPDATE t SET note = NULL WHERE note = '';), or comparisons that matched empty strings will silently start matching NULL semantics.
No. SQL Server, PostgreSQL, MySQL and SQLite all store '' as a real value. Only Oracle collapses it, in VARCHAR2 and CHAR columns alike.
Blank-padding is invisible until a join compares CHAR to VARCHAR and stops matching.
TRUE is a keyword in four engines, but only PostgreSQL and Oracle 23ai back it with a real type. SQL Server has no TRUE at all.
CAST runs on all five engines; the native forms add format masks, style codes or a shorter spelling.
SQLly is a native SQL workbench for macOS, Windows and Linux. Its formatter and plan viewer work in all five dialects.