MySQL IF() takes three expressions and if the first expression is true, not zero and not NULL, it returns the second expression. Otherwise, it returns the third expression.
Depending on the context in which it is used, it returns either numeric or string value.
IF(expression ,expr_true, expr_false);
SELECT
id, IF(payment_date='1970-01-01 00:00:00', null, payment_date) as payment_date
FROM `student_detail`
0 comments:
Post a Comment