I'm trying to create a SQL query that tells me how many users there are that have one or more products.
I created this query which tells me all of the users that have products:
SELECT DISTINCT `users`.*
FROM `users`
INNER JOIN `products`
ON `users`.`id` = `products`.`creator_id`
However, I want the count of the users, not the users themselves.
So I created this query which uses the COUNT() function
SELECT DISTINCT COUNT(*)
FROM `users`
INNER JOIN `products`
ON `users`.`id` = `products`.`creator_id`
But I believe I'm using the COUNT incorrectly because this query returns 164 which is a lot more than the previous query returned.