事务1
begin transaction
update t set count= count +1 where id=A
update t set count=cunt+1 where id=b
end transaction
事务2
begin transaction
update t set count= count +1 where id=B
update t set count= count +1 where id=A
end transaction
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
正确方式,进行将update语句更加id排序。比如永远先更新A,然后更新B