Share on Google+Share on Google+

MySQL Boolean

Advertisement
This example illustrates how to find the boolean value.

MySQL Boolean

This example illustrates how to find the boolean value.

In this example we create a select query to show if we pass 0 then it will return false but when we set 1 then it will return true.

 

Query

 

Output

 

SELECT IF(0, 'true', 'false');

 

+------------------------+
| IF(0, 'true', 'false') |
+------------------------+
| false                  |
+------------------------+

 

SELECT IF(1, 'true', 'false');

 

+------------------------+
| IF(1, 'true', 'false') |
+------------------------+
| true                   |
+------------------------+

 

Advertisements

Posted on: December 9, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.