In this tutorial, I show How you can concatenate multiple columns in MySQL.
You can simply do this programmatically by separately select fields from MySQL Table and store their values in the single variable after concat their values.
But you can make the above process little simpler by concatenating the values while selecting rows from DataBase Table.
Let’s take a simple example –
You have two columns – firstname, lastname within your DataBase Table you want to show both the columns values in a single string form. In case you can MySQL functions to combine the values of the columns.
There are two functions for doing this –
Both functions work similar but have little difference.