s_str varchar(2000), s_split varchar(2)
begin
/*split分割字符串并放入临时表*/ declare lenstr int ; declare result varchar(248) default ''; declare i int DEFAULT 1; set lenstr= length(s_str)-length(replace(s_str, s_split, ''))+1; BEGIN drop table if exists tx_strlist; DROP TEMPORARY TABLE IF EXISTS tx_strlist; create temporary table tx_strlist(col VARCHAR(488) not null); while i<=lenstr DO set result =reverse(substring_index( reverse(substring_index(s_str, s_split, i)), s_split, 1)); INSERT into tx_strlist(col) values(result); set i=i+1; end while; end;end