UPDATE cms_projects pp SET is_archive WHERE pp id IN SELECT id FROM cm

1
2
3
4
5
6
7
8
UPDATE cms_projects pp SET is_archive=0
WHERE pp.id IN
(
SELECT p.id
FROM cms_projects p
JOIN cms_cash c ON p.id=c.project_id
WHERE c.dt > DATE_SUB(CURDATE(),INTERVAL 90 DAY)
)