I have a table with columns 'customer' and 'location' and I need to check top 10 locations visited by unique customers.
I'm ready to do the following:
Now, this sounds like a rather stupid solution, but I'm rather unacquainted with nested queries. Any help?
Thanks
SELECT location,count(distinct customer) as visitors from customer_locations
GROUP BY location
ORDER BY visitors DESC
LIMIT 10
Gets the top 10 locations by number of unique visitors