Problem Description

Create month-wise revenue and also show a rolling 3-month total. First aggregate by month, then apply a window sum over the last 3 months.

Input Format

SQL query

Output Format

Result set

Sample Test Case

Input:
Orders(order_date, total_amount)
Output:
Monthly rows

Constraints

Assume PostgreSQL-style DATE_TRUNC

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next