r/learnSQL • • May 01 '26
SQL Question
orders (order_id , customer_id , order_date , order_amount)
find the customer who purchased for every month in 2025
19
Upvotes
r/learnSQL • • May 01 '26
orders (order_id , customer_id , order_date , order_amount)
find the customer who purchased for every month in 2025
View all comments
Show parent comment
3
u/Horror-Paint5708 May 01 '26
Having count(Distinct Month (order data))=12 i think you need to add distinct to prevent from giving false positive incase someone only purchased 12 times in one month only.