MySQL 获取农历月份函数

来源:互联网 发布:linux命令echo使用简介 编辑:程序博客网 时间:2024/05/01 12:05
BEGINdeclare temp_num int;declare chn_str varchar(10);declare num_strvarchar(20);declare res_month varchar(20);declare jint;set chn_str = '正二三四五六七八九';set temp_num = num + 0;set res_month = '';if temp_num > 0 and temp_num < 10 thenset 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

原创粉丝点击