How to make GROUP BY output queries where count(column) >= 0?

SELECT `categories`.`id`, count(`redirects`.`category_id`) 
FROM `categories`
INNER JOIN `redirects`
ON `categories`.`id` = `redirects`.`category_id`
WHERE 1
GROUP BY `redirect`.`category_id`


Displays only matches where more than one, but I would like to remove and rows where the GROUP BY 0 or more.

More in detail describe the task

There are two tables, the field category_id in the table 2 refers to the id field of the categories table. You need to count the number of records in the second table, grouping them by id of table 1. But only displays matches that are more than one, and need to output the same result if a category has no entry at all (0)

5a748fa582639075143205.png
All entries on the right should be displayed in the results on the left, even if records with the same ID in the table redirects 0
June 8th 19 at 16:41
2 answers
June 8th 19 at 16:43
Solution
Use LEFT JOIN
Not going to brag, was guesswork. Thanks a lot for the right hint, have a great evening - mae_Ernser commented on June 8th 19 at 16:46
June 8th 19 at 16:45
read about .... having .... the select command

Find more questions by tags MySQLSQL