What would be the simplest way to locate the index of the third space in a string.
My goal is to get CCC out of this space separated list: AAAA BB
CCC
AAAA BB
You would want to use SUBSTRING_INDEX function like this
SUBSTRING_INDEX
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(field, ' ', 3), ' ', -1) FROM table
The inner function call would get you to AAAA BBBB CCCC while the outer function call would pare that down to just CCCC.
AAAA BBBB CCCC
CCCC