Skip to content

Instantly share code, notes, and snippets.

@mariuz
Created January 3, 2011 09:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariuz/763284 to your computer and use it in GitHub Desktop.
Save mariuz/763284 to your computer and use it in GitHub Desktop.
testing select from boolean columns in firebird 3.0 http://asfernandes.blogspot.com/2010/12/introducing-boolean-datatype.html
Check what values we have
SQL> SELECT * from true_values;
COLUMN_ONE COLUMN_TWO
========== ==========
<false> <false>
<true> <false>
<true> <false>
<false> <true>
<false> <true>
<true> <true>
--Check the disjunction (Logical or )
--http://en.wikipedia.org/wiki/Truth_table#Logical_disjunction
SQL> SELECT column_one or column_two from true_values;
=======
<false>
<true>
<true>
<true>
<true>
<true>
--Check the conjunction (Logical and)
--http://en.wikipedia.org/wiki/Truth_table#Logical_conjunction
SQL> SELECT column_one and column_two from true_values;
=======
<false>
<false>
<false>
<false>
<false>
<true>
--Check the negation
--
SQL> select not(column_one) from true_values;
@thaiviet1994
Copy link

Creating a “truth table” is not hard, you can use an useful tool (CKod, at http://ckod.sourceforge.net/_/) to make a “truth table”.

  1. CKod homepage: http://ckod.sourceforge.net/
  2. CKod online: http://ckod.sourceforge.net/_/
  3. CKod forum: http://ckod.sourceforge.net/~/

Good luck to you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment