首页  >  问答  >  正文

MySQL中更新数据[update]无法成功的疑问

女神的闺蜜爱上我女神的闺蜜爱上我2672 天前778

全部回复(3)我来回复

  • 三叔

    三叔2017-06-26 10:51:26

    改为 where id IS NULL 即可
    MySQL里面不能用等号判断NULL。

    详见:
    https://dev.mysql.com/doc/ref...

    回复
    0
  • PHP中文网

    PHP中文网2017-06-26 10:51:26

    where id is null

    回复
    0
  • 代言

    代言2017-06-26 10:51:26

    一般更新语句,保险起见,先验证下数据量及确认下更新内容

    #update defaultdemo
    #set id = 19
    select id 
    from defaultdemo
    where id is null;

    回复
    0
  • 取消回复