The below statement is yielding everything past the first word in vendor_name. I need it to yield ONLY the second word in vendor_name while using the substring. I also need it to return a blank field if NULL. Is this possible?
select substring_index(vendor_name, ' ',-2) as 'Second Word'
from vendors;
Edit: I am thinking it needs to be something along these lines but I cannot get it to work: substring_index(substring_index(vendor_name, ' ', -2)vendor_name, ' ', 1) as 'Second Word'