Right, I'm trying to update two tables:
jobs
regions
And I am trying to update the same column in both (jobs.greater_region_id, regions.greater_region_id) to the same value, based on them both having the same value in (jobs.region_id, regions.region_id).
Now, I know this could be done with two UPDATE querys, but I want to learn how to do this.
The only thing I cannot work out here is the WHERE clause:
UPDATE regions, jobs SET regions.greater_region_id = "", jobs.greater_region_id = "" WHERE regions.region_id = "" AND jobs.region_id = ""
----
UPDATE regions, jobs SET regions.greater_region_id = "", jobs.greater_region_id = "" WHERE regions.region_id = "" OR jobs.region_id = ""
So, my question: do I need to use AND or OR here? Or, (and I don't know if this is valid SQL)
WHERE jobs.region_id, regions.region_id = ""
?