This is not a problem that needs answering, more of a query on why this is happening.
I have a field in one table that is populated with 'Y' Or 'N', and i have a query that simply takes the value of that field and pops into another table
The table has approximately 25,000 records in it
The query below takes about 25 seconds to run
UPDATE ObjectivesApproved
INNER JOIN Approved
ON ObjectivesApproved.ID = Approved.ID
SET ObjectivesApproved.Football = [Approved].[Cri Football Related];
Removing the JOIN operation makes the query take even longer.
If however i do the below, the entire operation takes less than 5 seconds, even though it's executing 2 queries
UPDATE ObjectivesApproved
INNER JOIN Approved
ON ObjectivesApproved.ID = Approved.ID
SET ObjectivesApproved.Football = 'Y'
WHERE (([Approved].[Cri Football Related]='Y'));
UPDATE Approved
INNER JOIN ObjectivesApproved
ON Approved.ID = ObjectivesApproved.ID
SET ObjectivesApproved.Football = 'N'
WHERE (([ObjectivesApproved].[Football] Is Null));
I'm happy with my workaround, even if it is a little inelegant, but to further my understanding of SQL why might this be happening?