事务-2-具体使用
作者:互联网
步骤一:开始事务
set autocomit=0;
start transaction;可选的
步骤二:编写事务中的sql语句(select insert update delete)
语句1;
语句2;
。。。
步骤3:结束事务
commit:提交事务
rollback:回滚事务;
savepoint:节点名;设置保存点
演示savepoint用
set autocommit=0;
start transaction;
delete from account where id=25;
savepoint a;
delete from account where id=28;
rollback to a;
标签:语句,事务,set,步骤,savepoint,具体,使用,delete 来源: https://www.cnblogs.com/zyb-luckey/p/16540177.html