Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Seem hard at first glance? Try to divide this problem into some sub-problems. Think about how to calculate the cumulative sum of one employee, how to get the cumulative sum for many employees, and how to except the most recent month of the result.
Use the technique of self-join if you have only one table but to write a complex query.
Still remember how to use the function `sum` and `max`?