I am trying to execute something like that:
UPDATE page_results
SET cache_valid=0
WHERE link_id IN (SELECT DISTINCT l.link_id
FROM link_results AS l
INNER JOIN page_results AS p ON p.link_id=p.link_id
WHERE has_no_robots=0 AND cache_valid=1 AND cache_to_expire=1 AND status_code!='404' AND href!='' AND anchor_match!='' AND nofollow=0)
Basically, I want to update all the results , that are taken from the derived table..
The other solution that I had was this:
UPDATE (SELECT DISTINCT l.link_id
FROM link_results AS l
INNER JOIN page_results AS p ON p.link_id=p.link_id
WHERE has_no_robots=0 AND cache_valid=1 AND cache_to_expire=1 AND status_code!='404' AND href!='' AND anchor_match!='' AND nofollow=0)
SET cache_valid=0
But that didnt work either.. Is there a way to acheive my goal?
Here is the right syntax to do this: