开发者社区 问答 正文

我想更新表中的某个字段为其中一个字段的值 400 请求报错 

我想更新表中的某个字段为其中一个字段的值,但是语句怎么完蛋呢,谢谢 update system set cmfYsyf_no=ysyf_no where id in (select cmfTag from system where cmfTag is not null)   这样出错

展开
收起
kun坤 2020-05-29 23:09:34 590 分享
分享
版权
举报
1 条回答
写回答
取消 提交回答
  • --- update system as a,(select * from system where cmfTag is not null)as b  set  a.cmfYsyf_no   =  b.ysyf_no where a.id=b.cmfTag   这样也不行######update system t set t.cmfYsyf_no=(select s.ysyf_no from system s where s.id=t.id)  试试看 ###### mysql下直接通过######MySql中更新此表的话。后面的子语句不能查询此表的 update system set cmfYsyf_no=ysyf_no  where cmfTag is not null

    2020-05-29 23:09:39 举报
    赞同 评论

    评论

    全部评论 (0)

    登录后可评论
问答地址:
AI助理

你好,我是AI助理

可以解答问题、推荐解决方案等