Update concat text with null value in mysql

The trasaction table description field has some meaning, it works fine. description feild default value is NULL, its not working.

update transaction set domain='hiox.com',description=CONACT(description,',domain swapped from hioxindia.com to hiox.com') where id=23602

help me..

+5
source share
1 answer

Use ifnull():

update `transaction` 
   set domain='hiox.com',
   description=CONCAT(ifnull(description, ''), ',domain swapped from hioxindia.com to hiox.com') 
where id=23602

Documentation

+10
source

All Articles