I want to see the number of customers who only shopped in one specific store during a specific period, so I wrote the following SQL:
SELECT COUNT (DISTINCT CARD_NUMBER) FROM WHERE DATE BETWEEN ‘XXXX-XX-XX’(DATE) AND ‘XXXX-XX-XX’(DATE) AND STORE_NUMBER = 1234;
What if these customers (card holders) shop in other store chains? I couldn’t use AND CARD_NUMBER NOT IN… Because we have too many stores. Any syntax that could be used here to solve this problem?
