text: SELECT   A.Id, MAX(B.Month) as Month, SUM(B.Salary) as Salary
  FROM     Employee A, Employee B
  WHERE    A.Id = B.Id AND B.Month BETWEEN (A.Month-3) AND (A.Month-1)
  GROUP BY A.Id, A.Month
  ORDER BY Id, Month DESC