这样写可以吗 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;解决 无用评论 打赏 举报
这样写可以吗 insert into table1 where uid=2 select * from table2 where sid=1
你 table2的uid=2已经存在了,咋还插入了,应该是更新把
UPDATE table1 SET field1 = (SELECT field2 FROM table2 WHERE sid =1) WHERE sid = 2;