赞
踩
--本周星期几
select if(pmod(datediff('2020-07-08', '1920-01-01') - 3, 7)='0', 7, pmod(datediff('2020-07-08', '1920-01-01') - 3, 7));
--一年的第几周,跨年的周算在周天数比较多的年份
select year(date_sub(next_day('2021-01-01','mo'),4))*100+weekofyear('2021-01-01');
--本周周一日期
select date_sub('2020-07-08',pmod(datediff('2020-07-08','1900-01-08'),7));
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。