更新一张表的字段到另一张表
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
更新一张表的字段到另一张表
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