Skip to content

Instantly share code, notes, and snippets.

@arnehormann
Created January 24, 2013 17:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arnehormann/4625768 to your computer and use it in GitHub Desktop.
Save arnehormann/4625768 to your computer and use it in GitHub Desktop.
Truthiness and MySQL
SELECT
NULL, # \N
false, # 0
true, # 1
0 = false, # 1
1 = true, # 1
2 = true, # 0
true - false = 0, # 0
true + false = 1, # 1
true = null, # \N
false = null, # \N
true != null, # \N
false != null, # \N
true is null, # 0
false is null # 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment