The IS DISTINCT FROM predicate

The SQL-1999 standard specifies a useful IS DISTINCT FROM predicate, that behaves slightly different from the regular not equal comparison predicate. Here is its simple definition: 8.13 <distinct predicate> Format <distinct predicate> ::= <row value expression 3> IS DISTINCT FROM <row value expression 4> <row value expression 3> ::= <row value expression> <row value expression … Continue reading The IS DISTINCT FROM predicate

SQL and booleans, some trivia

Some trivia about SQL and booleans: SQL 1992 defines three values for a boolean: <truth value> ::= TRUE | FALSE | UNKNOWN True booleans aren't always supported, though. Here's the truth table of boolean support: SQL DialectSupports booleansDB20 (use 1/0 instead)Derbytrue (you can safely use true/false)H2trueHSQLDBtrueIngrestrueMySQLtrueOracle0PostgrestrueSQL Server0SQLite0Sybase ASE0Sybase SQL Anywhere0 Trivia... but nice to know.