Showing posts with label if function. Show all posts
Showing posts with label if function. Show all posts

Monday, 30 June 2014

MySQL IF function

MySQL IF function
Syntax: IF(expr,if_true_expr,if_false_expr)
Example:
SELECT IF(1 = 2,'true','false'); -- false
SELECT IF(1 = 1,' true','false'); -- true