I don't know if this will help you any or not, but this would be the approach for Microsoft Sql Server, minus the 12 month part of the equation, which would be a little bit of work in T-Sql if the date is stored in this format to cast it as a date and run a where over that date.
CREATE TABLE #temp (yyyymm int, revenue int)
INSERT INTO #temp
(
yyyymm,
revenue
)
VALUES
(201701, 450), (201701, 600), (201702,350)
SELECT
yyyymm,
SUM(revenue)
From #temp
GROUP BY #temp.yyyymm
DROP TABLE #temp