输入1-53周,输出1-53周的开始时间和结束时间

create procedure getweekrange(num int)
begin
select x.start,adddate(x.start,6) as end from (
select adddate(first,(num-week(first,5))*7-weekday(first)) as start from 
(select makedate(year(now()),1) as first)t)x; 
end 
原文地址:https://www.cnblogs.com/cexm/p/6265849.html