Rodolfo Bandeira

Rodolfo Bandeira

software, electronics, security, devops, thoughts

How to use CONCAT() in MySQL with NULL values

Do you want to use CONCAT with NULL fields in MySQL? If you just use CONCAT with some null field, you’ll get a null concatenated field.

Just use IFNULL() in MySQL.

CONCAT(IFNULL(NAME_A,”), IFNULL(NAME_B,”)) as NEW_NAME

Rodolfo

Last modified:

LinkedIn
WhatsApp