表A
id name url
1 a aa.com
表B
id aid name url
1 a aa.com
想要把表B中 name和url都等于表A中记录的aid赋值为表A中的id
------解决方案--------------------
- SQL code
update Bset aid=a.IDfrom Awhere a.Name=b.Name and a.Url=b.Url
------解决方案--------------------
update B set B.aid=A.id from A where B.name=A.name and B.url =A.url