Anda dapat mencoba memasukkan sum dan date_trunc Anda di subquery , seperti di bawah ini:
SELECT colA, SUM(colB) FROM (SELECT date_trunc('month',UA.activity_date) colA,SUM(UA.points) colB FROM user_activity UA
WHERE UA.activity_date > '01/01/2014' AND UA.activity_date < '12/31/2014'
GROUP BY UA.activity_date
ORDER BY date_trunc('month',UA.activity_date))sub GROUP BY colA
Lakukan group by di outerquery lagi. Lihat apakah itu membantu.