1##syntax:
2SELECT IFNULL(col_with_null_value, default_value);
3
4##you can see the result select with the string NA where the document is null:
5SELECT IFNULL(user_document_id, 'NA');
1IF condition1 THEN
2 statements;
3ELSEIF condition2 THEN # OPTIONAL
4 statements;
5ELSE # OPTIONAL
6 statements;
7END IF;
1 SELECT
2 contactname, IFNULL(bizphone, homephone) phone
3FROM
4 contacts;