例如字符串 abc/def/gh/ijk 取最后一个/之前的值即abc/def/gh
实现函数:substring_index、length、replace
select substring_index(‘abc/def/gh/ijk’,’/’,length(replace(‘abc/def/gh/ijk’,’/’,’//’))-length(‘abc/def/gh/ijk’))
关键点解析:length(replace(‘abc/def/gh/ijk’,’/’,’//’))-length(‘abc/def/gh/ijk’)求出/的个数