MySQL CONCAT function (merge columns together)

This doesn’t happen often that it’s necessary to do on the database side but I feel like this would save a step during PHP development and let MySQL do some work.

In MySQL, the function CONCAT() – returns a string where arguments (columns/string in database) are joined together to make one string. You can read more on the description of this function here.

Let’s say you have two columns, FIRST_NAME and LAST_NAME. To join these two columns together in MySQL you would use the following SQL statement:

This will return a result set with first name and last name joined together so you don’t have to do this using PHP processing.

2 thoughts on “MySQL CONCAT function (merge columns together)

  1. investeringsportfölj

    I would really prefer to show my value for your kindness giving support to help folks who hold the requirement of help with this theme. Special commitment which will get the solution across ended up being extraordinarily informative and has constantly really helped some individuals much like me to achieve their goals. The warm and friendly valuable information denotes a lot to me personally and a great deal more to help my office workers. Greatest wishes; coming from everyone people.


Leave a Reply

Your email address will not be published. Required fields are marked *