START TRANSACTION; SELECT @A:=SUM(salary) FROM table1 WHERE type=1; UPDATE table2 SET summary=@A WHERE type=1; COMMIT; When you start a transaction with START TRANSACTION, autocommit is disabled until you finish it with COMMIT or ROLLBACK. The autocommit mode then reverts to its prior state.
Vishalini.R Answered question July 6, 2023
