get underscore char not in first and last position of string in mysql code example
Example: find last instance of character in string mysql
SELECT SUBSTRING_INDEX("first_middle_last", '_', -1);
SELECT SUBSTRING_INDEX("first_middle_last", '_', -1);