update DCC set DRR=
(select cast((CAST((SUM(EMI)/100) AS DECIMAL(2,2))+CAST((SUM([REPO ARREAR])/100) AS DECIMAL(2,2))) as decimal(2,2))/((TOTAL*35)/100)/0.01
from dcc
where (CURR_DATE BETWEEN '2014-01-01' and '2014-01-03')
GROUP BY TOTAL )
这是我的查询我必须使用select query将值存储在DRR中。
错误:子查询返回的值超过1。当子查询遵循=,!=,<,< =,>,> =或子查询用作表达式时,不允许这样做。 声明已经终止。
答案 0 :(得分:0)
替换
行select cast((CAST((SUM(EMI)/100) AS DECIMAL(2,2)
带
select TOP 1 cast((CAST((SUM(EMI)/100) AS DECIMAL(2,2)
更新行的列值时,需要为其提供单个标量值。