I am trying to set a value in one table to the sum of the values ββin another table. Something like that:
UPDATE table1 SET field1 = SUM(table2.field2) FROM table1 INNER JOIN table2 ON table1.field3 = table2.field3 GROUP BY table1.field3
Of course, since it's worth it, it wonβt work - SET does not support SUM and does not support GROUP BY .
I should know this, but my mind draws a space. What am I doing wrong?
sql sql-server tsql
Margaret Jan 05 '10 at 23:25 2010-01-05 23:25
source share