Finding Customers who made a purchase and customer who did not make a purchase
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