I am trying to update all rows in a table based upon values found in another table. Below is an example of what I am trying to accomplish...
UPDATE table1 t1
SET t1.column1 =
SUM(
SELECT t2.column1
FROM table2 t2
WHERE t1.column2 = t2.column2
AND t1.column3 = t2.column3
AND t2.column4 = 'GROUP')
I don't believe that I can reference the table being updated as above within my subselect, can I?
UPDATE table1 t1
SET t1.column1 =
SUM(
SELECT t2.column1
FROM table2 t2
WHERE t1.column2 = t2.column2
AND t1.column3 = t2.column3
AND t2.column4 = 'GROUP')
I don't believe that I can reference the table being updated as above within my subselect, can I?