How to concatenate First Name and Last Name in MySQL

In this tutorial you will learn how to concatenate first name and last name in MySQL? This example explain combine firstname and lastname in MySQL using query. Let’s see the sql query to concat first and last name as full name with space in mysql.

Users Table:

Here our users table look like where we have first name and last name column and we combine these two to as full_name.

SQL Query:

Here is the query to combine first_name and last_-name to as full_name.

SELECT id, CONCAT(first_name, ' ',last_name) as full_name, email, created_at FROM `users`

Output:

The output you will fonund after running this query.

How to combine first name, middle name and last name in SQL server?

SELECT id, CONCAT(first_name, ' ', middle_name, ' ',last_name)  as full_name, email, created_at 
FROM `users`

I hope its work for you.

Leave a Comment