sql

更新一张表的字段到另一张表
update Item set cost=b.avg_cost from Item,(select MAX(avg_cost) as avg_cost,item_id from Stock group by item_id) b
where item.item_id=b.item_id

原文地址:https://www.cnblogs.com/suan1717/p/6245615.html