Your requirement is a bit vague. So I will assume that the column 'new_TotalNoofPlanMembers' is a previously calculated value. Then in that case I think what you are looking for is COUNT and not SUM (if these are discrete memberships and not money values for instance). Finally, when doing an aggregate such as COUNT or SUM you need to either have a GROUP BY clause or use a windowing function like this: