SQL , select last word in string

SELECT SUBSTRING_INDEX(TRIM(`lastname`), ‘ ‘, –1FROM name
set last name in other column
UPDATE `names` set `surname` = SUBSTRING_INDEX(TRIM(`name`),’ ‘, -1)
Remove Last Word from string
UPDATE names SET fullname=RTRIM(REVERSE(SUBSTRING(REVERSE(fullname),LOCATE(" ",REVERSE(fullname)))))