如何在SQL中使用JOIN执行UPDATE语句? - How can I do an UPDATE statement with JOIN in SQL?

问题:

I need to update this table in SQL Server 2005 with data from its 'parent' table, see below: 我须要使用其“父”表中的数据更新SQL Server 2005中的此表,请参见下文: this

sale 销售 spa

id (int)
udid (int)
assid (int)

ud ud .net

id  (int)
assid  (int)

sale.assid contains the correct value to update ud.assid . sale.assid包含更新ud.assid的正确值。 code

What query will do this? 什么查询将执行此操做? I'm thinking a join but I'm not sure if it's possible. 我正在考虑join但不肯定是否可行。 get


解决方案:

参考一: https://stackoom.com/question/5QSA/如何在SQL中使用JOIN执行UPDATE语句
参考二: https://oldbug.net/q/5QSA/How-can-I-do-an-UPDATE-statement-with-JOIN-in-SQL
相关文章
相关标签/搜索