1START TRANSACTION;
2SELECT @A:=SUM(salary) FROM table1 WHERE type=1;
3UPDATE table2 SET summary=@A WHERE type=1;
4COMMIT;
1START TRANSACTION
2 [transaction_characteristic [, transaction_characteristic] ...]
3
4transaction_characteristic: {
5 WITH CONSISTENT SNAPSHOT
6 | READ WRITE
7 | READ ONLY
8}
9
10BEGIN [WORK]
11COMMIT [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
12ROLLBACK [WORK] [AND [NO] CHAIN] [[NO] RELEASE]
13SET autocommit = {0 | 1}