Using IF() function to compare numbers : IF : Control Flow Functions MySQL TUTORIALS


MySQL TUTORIALS » Control Flow Functions » IF »

 

Using IF() function to compare numbers


mysql>
mysql> SELECT IF(15>10,'Yup','Nope');
+------------------------+
| IF(15>10,'Yup','Nope') |
+------------------------+
| Yup                    |
+------------------------+
row in set (0.02 sec)

mysql>
mysql> SELECT IF(5>10,'Yup','Nope');
+-----------------------+
| IF(5>10,'Yup','Nope') |
+-----------------------+
| Nope                  |
+-----------------------+
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 Control Flow Functions
» IF