SQL and booleans, some trivia

Some trivia about SQL and booleans:

SQL 1992 defines three values for a boolean:

<truth value> ::=
      | FALSE
      | UNKNOWN

True booleans aren’t always supported, though. Here’s the truth table of boolean support:

SQL Dialect Supports booleans
DB2 0 (use 1/0 instead)
Derby true (you can safely use true/false)
H2 true
Ingres true
MySQL true
Oracle 0
Postgres true
SQL Server 0
SQLite 0
Sybase ASE 0
Sybase SQL Anywhere 0

Trivia… but nice to know.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.