CONCAT multiple fields to a single field, single spaced
I'm trying to concatenate a first middle maiden and last name fields and use that to update a single field which is named fullname For each user any combination of these 4 fields can be filled. From 0 to all 4. However I also need a single space between each name (not multiple spaces). UPDATE nameTable SET fullname = CONCAT(first, middle, maiden, last); MySQL has CONCAT_WS - concatenate with separator CONCAT_WS(' ', first, middle, maiden, last); http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_concat-ws As pointed out by andr below, make sure any concatenated fields