通过多列更新 mysql table 中的一系列行

update a range of rows in a mysql table via many colums

我有一个包含年、月、日和请求列的 table。我需要更新以下 table 中的范围,该范围从年 = 2022、月 = 6、日 = 7 开始,以年 = 2022、月 = 9、日 = 16 结束。请求值必须 = 9它的插入依赖于 dow

year| month| day| dow|req|
----+------+----+----+---+
2022|  6   |  4 | sat| 5 |
2022|  6   |  5 | sun| 5 |
2022|  6   |  6 | mon| 5 |
2022|  6   |  7 | tue| 9 |
2022|  6   |  8 | wed| 9 |
2022|  6   |  9 | thu| 9 |
2022|  6   | 10 | fri| 9 |
---  ---  ---  ---  ---  
2022|  9   | 13 | tue| 9 |
2022|  9   | 14 | wed| 9 |
2022|  9   | 15 | thu| 9 |
2022|  9   | 16 | fri| 9 |
2022|  9   | 17 | sat| 3 |
2022|  9   | 18 | sun| 3 |
2022|  9   | 19 | mon| 3 |
---  ---  ---  ---  --- 

这是我的查询

x_req = 'mon'
query = "UPDATE `calendar` SET '%s' = '%s' WHERE year = '%s' AND (month BETWEEN '%s' AND '%s') AND dow = '%s' " %(request, nbr, year, s_month, e_month, x_req)
Functions.handleQuery(self, query)

但此查询还会更新 6 月 3 日以及 11 月 23 日和 30 日。 如何让查询在选定的日期开始和结束

where (year,month,day) >= (2022,6,7) and (year,month,day) <= (2022,9,16)