0 votes
in Oracle by
Calculate the total revenue generated by each customer in the last three months.

1 Answer

0 votes
by
SELECT customer_id, SUM(revenue) AS total_revenue

FROM sales

WHERE transaction_date >= TRUNC(SYSDATE) - INTERVAL '3' MONTH

GROUP BY customer_id;
...