I have a mysql table with following columns
order_id
customer_id
total_amount
date_added
Now, i would like to make a query for a particular customer to know if the customer has made more than or equal to 12000$ amount of order over six months period of his/her order history. The period is not recent.
Is there any solution for this?
Regards,
Dipen
Replace nnn with the particular customer ID, and YYYY-MM-DD with the start of the 6 month period that you’re interested in.
UPDATE:
This will use the 6 month period leading up to the customer’s last order:
UPDATE 2: