How to Concatenate Strings in MySQL

The use of the “+” or “||” concatenation operators in MySQL are different from most DBMSs. MySQL uses the concat function:

select concat(first_name, ‘ ’, last_name) as name from student;
name
John Doe

The concat function allows various parameters. One disadvantage of using the concat function is a null value in any of the parameters being used will result in a null value.

select concat(‘John’,null,‘Doe’) as result ;
result
null

IN THIS PAGE