sql - update query using select statement -
update dcc set drr= (select cast((cast((sum(emi)/100) decimal(2,2))+cast((sum([repo arrear])/100) decimal(2,2))) decimal(2,2))/((total*35)/100)/0.01 dcc (curr_date between '2014-01-01' , '2014-01-03') group total )
this query have store value in drr using select query.
error: subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. statement has been terminated.
replace line
select cast((cast((sum(emi)/100) decimal(2,2)
with
select top 1 cast((cast((sum(emi)/100) decimal(2,2)
when update row's column value, need provide single scalar value it.
Comments
Post a Comment