MySQL Concatenation Problem

SQL Concatenation - MySQL Concatenation Problem

mysql concatenation how to problem
Photo: uml.edu

How To Concatenate On MySQL

We've been migrating our current database platform from microsoft access to MySQL database. One of the problem that we encountered is the TOP command conflict on MySQL.

But it doesn't stop there, our current concatenation seems to be having a problem too.

Here's a sample code of our current SQL structure of our concatenation.

SELECT (lastname & ', ' & firstname) AS fullname
FROM employee
WHERE id_record=1;


Before, the full name is displayed on the browser. But after migration, the display was zero (0). Only later I found the fix for this problem, and here's the proper code structure.

SELECT CONCAT(lastname , ', ' , firstname) AS fullname
FROM employee
WHERE id_record=1;


So there you go, I just made this post to target this specific and simple tip, just in case that somewhere - someone out there faces the same problem too.

Hope this post will help someone, and if just in case, please let me know that this short article made its purpose by commenting below.

Thank you !

0 Comments :

Post a Comment