Posted By

jpkunst on 02/25/10


Tagged


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

virendrakryadav


Select the first word in a text field


 / Published in: MySQL
 

  1. SELECT IF(INSTR( `textfield`, ' ' ) > 0, SUBSTRING( `textfield` FROM 1 FOR (INSTR( `textfield`, ' ' ) -1 )), `textfield`) FROM `exampletable`;

Report this snippet  

You need to login to post a comment.