Skip to main content
2 of 3
Preformatted text and removed the irrelevant tags like SFMC, SQL Server

SQL Query to Group Shop Visits?

I am trying to group the number of times a subscriber has visited each unique store but am getting an error:

    select subscriberkey, storename, count (orderID) as shopvisits from salesorder 
    group by subscriberkey,storename

What is missing from/incorrect about this query?

Thanks