Concatenating null values in MySql

by Guna 2014-11-07 20:35:03

if you have null value in a column, concatenation will not work as expected. For that we can use ifnull() function.

ifnull() function takes two values and returns first value if its not null otherwise it returns second value.

Example:
update test set content=concat(ifnull(content,''),'test data') where id=1;

 

Tagged in:

572
like
0
dislike
0
mail
flag

You must LOGIN to add comments