weixin_43454098 2022-05-20 20:48 采纳率: 85.7%
浏览 28

将table1中sid=1的数据插入table2中uid=2数据中,mysql要怎么写啊?

这样写可以吗 insert into table1 where uid=2 select * from table2 where sid=1

  • 写回答

2条回答 默认 最新

  • 皮蛋不吃粥 2022-05-20 21:16
    关注

    你 table2的uid=2已经存在了,咋还插入了,应该是更新把

    UPDATE table1  SET field1 = (SELECT field2 FROM table2  WHERE sid =1)  WHERE sid = 2;
    
    评论

报告相同问题?

问题事件

  • 创建了问题 5月20日

悬赏问题

  • ¥15 单纯型python实现编译报错
  • ¥15 c++2013读写oracle
  • ¥15 c++ gmssl sm2验签demo
  • ¥15 关于模的完全剩余系(关键词-数学方法)
  • ¥15 有没有人懂这个博图程序怎么写,还要跟SFB连接,真的不会,求帮助
  • ¥15 PVE8.2.7无法成功使用a5000的vGPU,什么原因
  • ¥15 is not in the mmseg::model registry。报错,模型注册表找不到自定义模块。
  • ¥15 安装quartus II18.1时弹出此error,怎么解决?
  • ¥15 keil官网下载psn序列号在哪
  • ¥15 想用adb命令做一个通话软件,播放录音