Rodolfo Bandeira
Home Blog Posts Photos Videos Github Contact
<< All Posts
How to use CONCAT() in MySQL with NULL values

Apr 25, 2014


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



<< All Posts

Previous post:
Hashtag regex formatter in PHP
Most recent post:
How to block facebook to access your website using IPTABLES

rodolfo.io 🇧🇷 🇨🇦

Runs on OpenBSD 🐡
Twitter Github Linkedin RSS