where DATE(o.PurchaseDateTime) BETWEEN CURDATE() - INTERVAL 1 MONTH AND CURDATE()
group by c.CustomerID
複製代碼
This results in every CustomerID joining with every order
So if I have 6 customers
The results will be
6
1
1
1
1
1
How can I only get the first number, but I need o.PurchaseDateTime
Because I want to include the range of dates in the query.
Thanks