面试-秒杀下单 部分摘自https://github.com/yuanguangxin/LeetCode秒杀并发情况下库存为负数问题for update显示加锁 把udpate语句写在前边,先把数量-1,之后select出库存如果>-1就commit,否则rollback。update products set quantity = quantity-1 WHERE id=3;sele... 面试集锦 2023-09-03 155 点赞 2 评论 234 浏览