V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
zhxjdwh
V2EX  ›  问与答

update 能保证并发情况下的 数据一致性吗?

  •  
  •   zhxjdwh · 2021-07-26 11:36:48 +08:00 · 448 次点击
    这是一个创建于 998 天前的主题,其中的信息可能已经有所发展或是发生改变。
    请教一下各位大佬,
    这条 sql,并发情况下 能保证 money 永远不为负数吗?
    update account set money=money-100 where id=1 and money>100
    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3558 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 04:40 · PVG 12:40 · LAX 21:40 · JFK 00:40
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.