子查询在sql中返回了超过1个值
问题描述:
我有一个小的查询,当我运行它时,出现错误。请帮帮我。 查询:子查询在sql中返回了超过1个值
update MozendaData set [Sub Device]=
(select [Sub Device] from oldMozendaData
where MozendaData.[Product Details]=oldMozendaData.[Product Details])
where UserID ='APAC\gsvivekanand'
答
试试这个:
UPDATE m
SET m.[Sub Device] = o.[Sub Device]
FROM MozendaData AS m
INNER JOIN oldMozendaData AS o ON m.[Product Details] = o.[Product Details]
WHERE m.UserID ='APAC\gsvivekanand';
+0
感谢其任职 – user1632718 2013-02-27 06:50:01
+0
@ user1632718 - 欢迎你随时:)尝试去接受它,如果你有帮助。 – 2013-02-27 06:51:30
SQL 2008服务器 – user1632718 2013-02-27 06:44:43