Loading lesson path
Concept visual
Start at both ends
Return the specified value IF the expression is NULL, otherwise return the expression:
SELECT IFNULL(NULL, "W3Schools.com");The IFNULL() function returns a specified value if the expression is NULL. If the expression is NOT NULL, this function returns the expression.
expression, alt_value )
Required. The expression to test whether is NULL alt_value
Required. The value to return if expression is NULLFrom MySQL 4.0
Return the specified value IF the expression is NULL, otherwise return the expression:
SELECT IFNULL("Hello", "W3Schools.com");Return the specified value IF the expression is NULL, otherwise return the expression:
SELECT IFNULL(NULL, 500);❮ MySQL Functions