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 booleans
DB20 (use 1/0 instead)
Derbytrue (you can safely use true/false)
H2true
HSQLDBtrue
Ingrestrue
MySQLtrue
Oracle0
Postgrestrue
SQL Server0
SQLite0
Sybase ASE0
Sybase SQL Anywhere0

Trivia… but nice to know.

Leave a Reply