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

1 Answer

0 votes
SELECT customer_id, SUM(revenue) AS total_revenue

FROM sales

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

GROUP BY customer_id;
by
...