Mega Code Archive

 
Categories / MySQL Tutorial / Control Flow Functions
 

Using string comparison function with IF

mysql> mysql> SELECT IF(STRCMP('test','test1'),'no','yes'); +---------------------------------------+ | IF(STRCMP('test','test1'),'no','yes') | +---------------------------------------+ | no                                    | +---------------------------------------+ 1 row in set (0.00 sec) mysql>