当我执行子查询时,一切正常,现在我使用相同的查询来更新基于子查询结果的列,但它说子查询返回了超过 1 行,这是有道理的。我应该如何解决这个问题..
begin transaction
update trn_RatingAuto
set Rate = 0
where rate = (
SELECT ar.Rate
FROM trn_account ta
INNER JOIN trn_risk tr ON ta.AccountId=tr.AccountId
inner join trn_option ot on tr.riskid = ot.riskid
INNER JOIN trn_Rating ra ON ot.RatingId = ra.RatingId
INNER JOIN trn_RatingAuto ar on ra.RatingId = ar.RatingId
where ar.Rate is null
)