how do i get rows for each month which contain the store with the highest number of purchases?
my code is:
SELECT DATE_FORMAT(buyDate, '%M') as month, count(id) as numPurchases, store
from purchase, customerpurchases
where purchase.id = customerpurchases.purchaseid
group by month, store;
Best Answer