BEGIN
declare temp_num int;
declare chn_str varchar(10);
declare num_str varchar(20);
declare res_month varchar(20);
declare j int;
set chn_str = '正二三四五六七八九';
set temp_num = num + 0;
set res_month = '';
if temp_num > 0 and temp_num < 10 then
set num_str = temp_num;
set j = substring(num_str from 1 for 1);
set res_month = substring(chn_str from j for 1);
end if;
if temp_num = 10 then
set res_month = '十';
end if;
if temp_num = 11 then
set res_month = '冬';
end if;
if temp_num = 12 then
set res_month = '腊';
end if;
return res_month;
END
MySQL 获取农历月份函数
最新推荐文章于 2024-07-17 04:44:07 发布