troubleshooting Question

Finding Customers who made a purchase and customer who did not make a purchase

Avatar of fb1990
fb1990 asked on
SQL
4 Comments1 Solution54 ViewsLast Modified:
Hello EE,

Can someone please help me with a SQL code to get a list of customers who purchased at least 1 item in a giving month and customers who did not make a purchase in that same month? I want to show 1 for customers who made a purchase and 0 for customers who did not make a purchase.  I have 2 tables - a customer table and an order table.  The customer table contains all the customers while the order table contains only the customer who made a purchase in any giving month.  In my case, I want to show customers who made a purchase in the month of January 2020 customers who did not.

Both tables have the customer as an identifier while the orders table contains customerno, ordercount, and orderdate
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros