1. 取周一
SELECT SUBDATE(DATE_SUB(‘20160801‘,INTERVAL 1 DAY),DATE_FORMAT(DATE_SUB(‘20160801‘,INTERVAL 1 DAY),‘%w‘)-1) FROM DUAL
时间: 2024-10-12 17:23:50
1. 取周一
SELECT SUBDATE(DATE_SUB(‘20160801‘,INTERVAL 1 DAY),DATE_FORMAT(DATE_SUB(‘20160801‘,INTERVAL 1 DAY),‘%w‘)-1) FROM DUAL