请教mysql高人:如何将下面地址中的存储过程sp_print_result改写成自定义函数呢?以便对数据表中的字段(由逗号分隔)进行批处理。存储过程sp_print_result代码地址:https://www.jb51.net/article/158443.htm我试着改写了一下,运行不出结果:DELIMITER $$DROP FUNCTION IF EXISTS `func_print_result_x` $$ CREATE FUNCTION `func_print_result_x`( f_string varchar(1000),f_delimiter varchar(5)) RETURNS varchar(2550) CHARSET utf8BEGINdeclare c varchar(2550); -- Get the separated string. declare cnt int default 0; declare i int default 0; set cnt = func_get_split_string_total(f_string,f_delimiter); -- 手工创建一个物理表 -- create table tmp_print (num VARCHAR(255) not null); -- 清空物理表 delete from tmp_print; while i < cnt do set i = i + 1; insert into tmp_print(num) values (func_get_split_string(f_string,f_delimiter,i)); end while; select GROUP_CONCAT(distinct num order by num separator ",") from tmp_print; return c;END$$DELIMITER ;-- 测试运行结果为空:select func_print_result_x("aaa,123,12,234,123,123",",");