I have used
SELECT
SUBST(field_name, 1, Locate('',field_name)) AS first_word
FROM
table_name
and it works for the first word so I tried using last_word but still get the first word so I guess there must be a differet way??
Select SUBSTRING_INDEX(field_name,' ',-1)
http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_substring-index
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With