I used the SELECT COUNT(*) to check my WHERE statement and got the correct number of updates, however when I attempt the UPDATE I get a syntax error around line 3.
UPDATE scans AS s
SET s.sbjnum = d.sbjnum
JOIN details AS d on d.name = s.name
WHERE s.sbjnum =''
You have to have a FROM
to have a JOIN
UPDATE scans
SET sbjnum = d.sbjnum
FROM scans s
JOIN details AS d ON d.name = s.name
WHERE s.sbjnum =''
According to the MySQL manual you can write it like this:
UPDATE scans AS s
JOIN details AS d ON d.name = s.name
SET sbjnum = d.sbjnum
WHERE s.sbjnum =''