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
时间: 2024-12-29 11:07:07
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