Home Tutorial Php Sql MySQL Boolean

 
 

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

 

Related Tags for MySQL Boolean:


Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.