I have a table with 2 fields. Email, Extra
Every entry in the email field has a name then a space and then surname. eg. Ravi Naidoo
Is there a SQL query that I would be able to run that would move the surname to the Extra Table field and then remove it from the Email field along with the space?
Eg. Email field: Ravi Naidoo
after the change would be
Email field: Ravi
Extra field: Naidoo
I know that this query removes the space:
UPDATE your_table SET email = REPLACE(email, ' ', '')
But am unsure how to move the surname text to the Extra field at the same time.
Let's consider you string is like
Separate the values.
Now you can run the Sql
Have a nice day :)