I am using MySQL and MySQL Workbench 5.2 CE. When I try to concatenate 2 columns, last_name and first_name, it doesn't work :
last_name
first_name
select first_name + last_name as "Name" from test.student
MySQL is different from most DBMSs use of + or || for concatenation. It uses the CONCAT function:
+
||
CONCAT
SELECT CONCAT(first_name, " ", last_name) AS Name FROM test.student
As @eggyal pointed out in comments, you can enable string concatenation with the || operator in MySQL by setting the PIPES_AS_CONCAT SQL mode.
PIPES_AS_CONCAT
1.4m articles
1.4m replys
5 comments
56.9k users