Below is the update query which I am using for which I am receiving "Incorrect syntax near the keyword 'group'" error message.
update PORTFOLIO set p.PF_F_FREE4 = sum(CASE
WHEN c.FIXING_EXPR = 1 THEN
i.AMT_AFTER_XACT_DAT/(q.CUR_RATE)
ELSE
i.AMT_AFTER_XACT_DAT*(q.CUR_RATE)
END)
from PORTFOLIO p, ID_POS_CASH i, CURRENCY c, ID_CUR_QUOTE q
where p.PF_COD = i.PF_COD and i.CUR_COD = c.CUR_COD
and c.CUR_COD = q.CUR_COD and p.PF_C_FREE20 NOT IN ( 'NO ACI PARTICIPATION', NULL)
and i.SETTLE_DAT = (select POS_MODIFIED_TO from ID_BAT_DAT)
and (i.AMT_AFTER_XACT_DAT <> 0 or i.AMT_CURRENT<>0)
group by i.CUR_COD having count(i.CUR_COD) >= 1
Can someone help me with the above?