How to split the name string in mysql?
I’ve separated this answer into two(2) methods. The first method will separate your fullname field into first, middle, and last names. The middle name will show as NULL if there is no middle name. SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(fullname, ‘ ‘, 1), ‘ ‘, -1) AS first_name, If( length(fullname) – length(replace(fullname, ‘ ‘, ”))>1, SUBSTRING_INDEX(SUBSTRING_INDEX(fullname, ‘ ‘, 2), … Read more