日期:2014-05-17  浏览次数:20480 次

怎么更新数据啊,我的SQLServer2008

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