MySQL Forums
Forum List  »  Stored Procedures

Re: Can someone please explain me
Posted by: Peter Brawley
Date: August 24, 2014 08:45PM

It'd be more clear if it were written as ...

SELECT p.customer_id, sum(p_ammount) s, count(customer_id) N
FROM payment AS p
WHERE DATE(p.payment_date) BETWEEN last_month_start AND last_month_end
GROUP BY customer_id
HAVING s > min_dollar_amount_purchased and n > min_monthly_purchases;

Options: ReplyQuote


Subject
Views
Written By
Posted
2046
August 24, 2014 12:56PM
Re: Can someone please explain me
851
August 24, 2014 08:45PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.