Aggregate function in an SQL update query?
Use:
UPDATE table1
SET field1 = (SELECT SUM(t2.field2)
FROM TABLE2 t2
WHERE t2.field3 = field2)
UPDATE t1
SET t1.field1 = t2.field2Sum
FROM table1 t1
INNER JOIN (select field3, sum(field2) as field2Sum
from table2
group by field3) as t2
on t2.field3 = t1.field3
Or you could use a mix of JBrooks and OMG Ponies answers:
UPDATE table1
SET field1 = (SELECT SUM(field2)
FROM table2 AS t2
WHERE t2.field3 = t1.field3)
FROM table1 AS t1