0
我正试图对远程服务器实施一波更新。下面是我使用的查询:这是有道理的,因为我想在源表中对应的值更新多条记录正在更新远程服务器表
subquery returned more than one value
:
update openquery(portal_mysql2, 'select * from memberstest_SL')
set fte_actual= (select [Full-time_enrollment]
FROM [BIDEV].[dbo].[TBL_IPEDS_HISTORY_NEW]
inner join openquery(Portal_mysql2, ' select * from memberstest_SL') on cast(unitid as varchar) = Right(nces_agencyid, 6)
where [year] = Year(GetDate())-2
and [Full-time_enrollment] <> '0'
and [Full-time_enrollment] is not null
and cast(unitid as varchar) = Right(nces_agencyid, 6)
)
这是返回错误。
任何人都知道我可以做到这一点?
关于错误:尝试使用'你的子查询中选择TOP 1全time_enrollment]'。如果你没有得到期望的结果,那么你应该改变更新的逻辑 – Marusyk
使用顶部(1)将用第一个值替换查询中的所有内容;这不是什么即时消息寻找 – slevin37
好吧,那么你应该更多地解释你想要什么。尝试使用UPDATE SELECT语句 – Marusyk