有没有办法根据左连接和分组依据的结果更新值?
我希望能够将当前工作的类别更新为可见,我在下面尝试过,但它不起作用
UPDATE category c
LEFT JOIN portfolio_job_category pjc
ON pjc.category_id = c.id
LEFT JOIN job j
ON j.id = pjc.job_id
SET c.visible = 0
WHERE (c.visible = 0
OR c.visible IS NULL)
AND j.end_date > CURRENT_DATE
GROUP BY cat_id