Mysql
 sql >> Datenbank >  >> RDS >> Mysql

UPDATE table1 SET column1 =(SUM(table2{&table3} WHERE table2_id1 =id1) WHERE id1 =table2_id1

UPDATE table1, table2 
SET table1.column1 = 
(
    SELECT SUM( 
        (SELECT constant FROM table3) +
        (SELECT table2.sum_number *** WHERE table2.table2_id1 = table1.id) 
    ) 
) 
WHERE table1.id = table2.table2_id1;

In dem mit Sternchen markierten Bereich oben steht kein "FROM table2,table1".