2
我試圖更新所有creditCounts
除了第一個(最低)帳號,但是我不斷收到此錯誤:SQL - 子查詢不引入EXISTS
Msg 116, Level 16, State 1, Line 8
Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.
下面是該查詢:
update Recog
set livesCount = 0
where RECID in (select
r.empNumber, r.acctNbr, r.creditCount, r.groupAcctNumber, r.groupType
from
Recog r
where
creditCount > 0
and policyNbr in
(
(Select acctNbr from Recog)
except
(Select MIN(acctNbr)
from Recog
Group By groupAcctNumber, groupType)
)
)
我該如何解決?
你在說'Where RECID in ...',然後給它5個字段。你只能在'in'中選擇一個。 – Santi