Home Tutorial Php Sql MySQL Boolean

 
 

Share on Google+Share on Google+
MySQL Boolean
Posted on: December 9, 2010 at 12:00 AM
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                   |
+------------------------+

 

Advertisement

Related Tags for MySQL Boolean:


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.

Posted on: December 9, 2010

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com