有道数据库的题目有答案还是不看懂,请前辈前来帮忙
有两个表A和B,均有key和value两个字段,如果B的key在A中也有,就把B的value替换为A中对应的value
update B b set b.value=(select max(a.value) from A a where b.key=a.key) where exists(select 1 from A c where b.key=c.key)
有A、B两表,表结构都为key和value。当B的key与A的key相同时将B的value赋给A的value
UPDATE A a,(select a.key,b.value from A INNER JOIN B on a.key=b.key) b SET a.value = b.value WHERE a.key = b.key