CONCAT() and RTRIM() both return NULL if any of their arguments are NULL.
So CONCAT(‘xyz’, NULL) returns NULL.
RTRIM(NULL) returns NULL.
CONCAT(‘xyz’, NULL, ‘123’) returns NULL.
coalesce(FIELD, ‘—‘)
You might want to use either IFNULL() or COALESCE() to turn the NULLs into empty strings. See http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html and http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html for docs on these functions.
CONCAT() and RTRIM() both return NULL if any of their arguments are NULL.
So CONCAT(‘xyz’, NULL) returns NULL.
RTRIM(NULL) returns NULL.
CONCAT(‘xyz’, NULL, ‘123’) returns NULL.
You might want to use either IFNULL() or COALESCE() to turn the NULLs into empty strings. See http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html and http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html for docs on these functions.