I have completed LeetCode SQL50 and pushed all the solved solutions per section on GitHub.
The IFNULL()
function returns a specified value if the expression is NULL
. The IFNULL()
function returns a specified value if the expression is NULL
. IFNULL(expression, alt_value)
expression
(Required)- The expression to test whether is NULL
alt_value
(Required)- The value to return if the expression is NULL
SELECT IFNULL(( -- Subquery here ), NULL) AS num;