General information
Category:
Databases,Tables, Views, Indexing and SQL syntax
Hello,
UPDATE Table1 SET Table1.Staff_ID = (SELECT Table2.KeyID FROM Table2 WHERE Table2.Location = Table1.Location)
if there is not a 100% 1-1 relation between the Location fields you might want to add
WHERE EXISTS (SELECT Table2.KeyID FROM Table2 WHERE Table2.Location = Table1.Location)
otherwise some rows might be overridden with NULL values
Regards
Christian
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only