MySQL query to extract first word from a field MySQL query to extract first word from a field mysql mysql

MySQL query to extract first word from a field


Here you go :)

SELECT SUBSTRING_INDEX( `field` , ' ', 1 ) AS `field_first_word`FROM `your_table`


select     substring(test_field, 1, instr(test_field, ' ')) from     test_table