select sum(A) as Sum_a, sum(B) as Sum_b from ( select a, b from my_table where c between :date1 and :date2 )