我如何更新特定用户从月初到该特定月末的记录?

How can i update a record of specfic user from start date of moth till the end of that specific month?

Database columns Image

UPDATE `agentstats` SET `total_target` = '150' from `agentstats` Where `date` BETWEEN '2022-01-01' and '2022-01-31'and`user_id` = 3
user_id is the foreign key 

这是我创建的查询,它不起作用。 谁能帮我一下。

您有一些语法错误。试试这个:

UPDATE `agentstats` 
SET `total_target` = '150'
Where `date` BETWEEN '2022-01-01' and '2022-01-31' and `user_id` = 3

基本上:删除from `agentstats` 并在'2022-01-31'and`user_id` = 3

中的and前后添加空格