SELECT [customerID], SUM([BALANCE_AMOUNT]) as sum_BALANCE_AMOUNT FROM [tableA] where 1=1 GROUP BY [customerID]