Oct 11, 2017

MySQL IFNULL() function lets you return an alternative value if an expression is NULL.

MySQL IFNULL() takes two expressions and if the first expression is not NULL, it returns the first expression. Otherwise, it returns the second expression.


IFNULL(expression, alt_value)

Parameter Values

Parameter Description
expression Required. The value to test whether is NULL
alt_value Required. The value to return if expression is a NULL value


  • The IFNULL() function returns the alt_value, if the expression is a NULL
  • The IFNULL() function returns the expression, if the expression is NOT NULL
Post a Comment

Featured Post

Setup Chinese Input Method in Ubuntu 17.10 Artful

sudo apt install ibus-sunpinyin After either of those commands do not forget to restart the IBus daemon ibus restart You might need t...