I would like to get all the characters in a field before a space
For example, if field1 is "chara ters"
field1
"chara ters"
I want it to return "chara"
"chara"
What would this select statement look like?
SELECT LEFT(field1,LOCATE(' ',field1) - 1)
Note that if the string in question contains no spaces, this will return an empty string.
2.1m questions
2.1m answers
60 comments
57.0k users