CREATE FUNCTION `func_splitString`
( f_string varchar(1000),f_delimiter varchar(5),f_order int)
RETURNS varchar(255) CHARSET utf8
BEGIN
declare result varchar(255) default '';
set result = reverse(substring_index(reverse(substring_index(f_string,f_delimiter,f_order)),f_delimiter,1));
return result;
END SELECT func_splitString('1,2,3,4,5,6,7',',',1);