database - How can I extract a last name from full name in mysql? -
i have table fullname column. want make query finding person via last name last name in full name column.
would matter if accidentally returned first name matched query?
a simple query be:
select * table fullname '%insertlastname%'
if want define last name name after last space:
select substring_index(fullname, ' ', -1) lastname table lastname='insertlastname'
two suboptimal answers, answers @ least.
Comments
Post a Comment