I have two tables (art and artlocation) that have three columns (series, style and location) in common. What I want to do is determine if all three fields are an exact match in BOTH tables then UPDATE one of the tables (as a foreign key) with the primary key of the other.
This is the query that I ran to determine if there is a match:
SELECT * FROM 'artlocation'
JOIN 'art' ON artlocation.series = art.series
WHERE artlocation.style = art.style
AND artlocation.location = art.location;
What I want to do is get the primary key from any match from the “artlocation” table and update the “art” table foreign key field. BUT I cannot FIGURE this out 🙁
Please help… thanks in advance!!
If I understand your question, you want a multiple table
UPDATE. You can use a JOIN in the table portion of theUPDATE