mysql中
#两种方式提交事务
#每行后面加';'
start transaction;
delete from xjgl_xsb where xsm='zhangsan';
commit;
begin;
delete from xjgl_xsb where xsm='zhangsan';
commit;
start transaction;
savepoint startonly;
delete from user where id='1';
savepoint executeone;
delete from user where id='2';
savepoint executetwo;
delete from user where id='3';
savepoint executethree;
delete from user where id='4';
savepoint executefour;
delete from user where id='5';
savepoint executefive;
delete from user where id='6';
rollback to savepoint executethree;
commit;
#savepoint之前的语句执行完毕
阅读(2544) | 评论(0) | 转发(0) |