mysql select column value based on if condition code example Example: mysql use if on select IF(expression ,expr_true, expr_false);