alex alex - 1 year ago 71
MySQL Question

How do I get first name and last name as whole name in a MYSQL query?

I want to be able to do something like this

SELECT `first_name` + " " + `last_name` as `whole_name` FROM `users`

So basically I get one column back
which is
concatenated together with a

How do I do that in SQL, or more specifically, MySQL ?

Answer Source

SELECT CONCAT_WS(" ", `first_name`, `last_name`) AS `whole_name` FROM `users`
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download