您的位置:首页 > 产品设计 > UI/UE

使用联接的SQL更新查询 - SQL update query using joins

2020-07-15 06:30 996 查看

钉钉、微博极速扩容黑科技,点击观看阿里云弹性计算年度发布会!>>>

问题:

I have to update a field with a value which is returned by a join of 3 tables. 我必须更新一个值,该值由3个表的联接返回。

Example: 例:

select
im.itemid
,im.sku as iSku
,gm.SKU as GSKU
,mm.ManufacturerId as ManuId
,mm.ManufacturerName
,im.mf_item_number
,mm.ManufacturerID
from
item_master im, group_master gm, Manufacturer_Master mm
where
im.mf_item_number like 'STA%'
and im.sku=gm.sku
and gm.ManufacturerID = mm.ManufacturerID
and gm.manufacturerID=34

I want to update the mf_item_number field values of table item_master with some other value which is joined in the above condition. 我想用其他在上述条件下加入的值更新表item_mastermf_item_number字段值。

How can I do this in MS SQL Server? 如何在MS SQL Server中执行此操作?

解决方案:

参考一: https://stackoom.com/question/47hX/使用联接的SQL更新查询
参考二: https://oldbug.net/q/47hX/SQL-update-query-using-joins
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  sql server
相关文章推荐