SELECT fdmaterial.FoodID
FROM [Restaurant].[dbo].[fdmaterial],[Restaurant].dbo.Martix where fdmaterial.FoodName =Martix.foodName1
update Martix [code=SQL][/code]
将选择出来的FoodID添加到表Matrix foodID1中,update语句具体怎么编辑啊,求解释
------解决方案--------------------
update b set b.foodid=a.foodid from [Restaurant].[dbo].[fdmaterial] a,[Restaurant].dbo.Martix b
where a.FoodName =b.foodName1