The values TRUE and FALSE are merely aliases for 1 and 0, respectively, as shown here : Boolean : Data Types MySQL TUTORIALS


MySQL TUTORIALS » Data Types » Boolean »

 

The values TRUE and FALSE are merely aliases for 1 and 0, respectively, as shown here


mysql>
mysql> SELECT IF(= FALSE, 'true', 'false');
+--------------------------------+
| IF(= FALSE, 'true', 'false') |
+--------------------------------+
true                           |
+--------------------------------+
row in set (0.00 sec)

mysql> SELECT IF(= TRUE, 'true', 'false');
+-------------------------------+
| IF(= TRUE, 'true', 'false') |
+-------------------------------+
true                          |
+-------------------------------+
row in set (0.00 sec)

mysql> SELECT IF(= TRUE, 'true', 'false');
+-------------------------------+
| IF(= TRUE, 'true', 'false') |
+-------------------------------+
false                         |
+-------------------------------+
row in set (0.00 sec)

mysql> SELECT IF(= FALSE, 'true', 'false');
+--------------------------------+
| IF(= FALSE, 'true', 'false') |
+--------------------------------+
false                          |
+--------------------------------+
row in set (0.00 sec)

mysql>



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

MySQL TUTORIALS

 Navioo Data Types
» Boolean