There are two ways to do this using MID and LOCATE or by just using SUBSTRING_INDEX

a. SELECT MID(,1,LOCATE(‘ ‘,)) FROM

b. SELECT SUBSTRING_INDEX( , ‘ ‘, 1 ) FROM

How to get the first word of a string using MySQL

Leave a Reply

Your e-mail address will not be published. Required fields are marked *

thirty four − = twenty seven