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');
Ivan The Terrible