开发者社区> 问答> 正文

我想更新表中的某个字段为其中一个字段的值 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 554 0
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
    赞同 展开评论 打赏
问答地址:
问答排行榜
最热
最新

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载