Skip to content
Advertisement

Tag: left-join

MySQL COUNT and IFNULL

I have tables like this: SQLFIDDLE I’m trying to count how many products are in each category SELECT `category_id`, `category_name`, IFNULL(count(*),0) cat_stat FROM `product_to_categories` …

Advertisement