For MySQL fans there, I like the IFNULL() function. Other answers here offer similar functionality with the ISNULL() function in some implementations. In my situation, I have a NOT NULL description column and a serial number column, which may be NULL This is how I combined them into a single column:
SELECT CONCAT(description,IFNULL(' SN: ', serial_number),'')) FROM my_table;
My results show that concatenating strings with NULL results in NULL . I get alternative value in these cases.
2NinerRomeo Jan 07 '15 at 7:17 2015-01-07 19:17
source share