i would like to get all the characters in a field before the blank
if field1 = "chara ters"
i want it to return chara
what would this select statement look like?
i would like to get all the characters in a field before the blank
if field1 = "chara ters"
i want it to return chara
what would this select statement look like?
You would need some string operations for that. Assuming every field has at least one space character:
SELECT SUBSTR(field1, 0, LOCATE(' ', field1)) FROM your_table;
Safe approach:
SELECT IF(
LOCATE(' ', field1),
SUBSTR(field1, 0, LOCATE(' ', field1)),
field1
) FROM your_table;