ifnull in mysql code example
Example 1: mysql ifnull
##syntax:
SELECT IFNULL(col_with_null_value, default_value);
##you can see the result select with the string NA where the document is null:
SELECT IFNULL(user_document_id, 'NA');
Example 2: if column value is null then in mysql
SELECT
contactname, IFNULL(bizphone, homephone) phone
FROM
contacts;
Example 3: mysql select default if null
IFNULL(MAX(EMAIL), "[email protected]") as email