For a new client project I was provided with database of users consisting of names, email addresses and managers.
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`manager` varchar(255) NOT NULL,
`status` varchar(255) NOT NULL
)
The name column contained both first and last names formatted last name first like:
Parker, Damon
MySQL’s SUBSTRING_INDEX() and TRIM() functions allow us to make quick work of this data manipulation. Using the query below and a new table similar to the first except with separate fields for first and last name we can copy the data to the new table and split the names in the process.
FROM `users`
Popularity: 1%
{ 0 comments }