Compute the sum of the previous group of rows and the sum of the current group of rows in SQL
I have a SQL table containing profit for a customer group, customer, project and year. I want to add the sum of the profit of the previous year for the current customer group and the sum of the profit of the current year for the current customer group to each row of the table.