Correct the essence of the issue, if not the right way to put it.
How can one query to get a list of records that would display all records but the number was only one record that fits the condition?
select c.color_id, c.color_name, count(p.product_id) as total
from color as c
left join product as p on c.color_id = p.color_id
where p.color_id = 2
group by c.color_id
In this example, the result will be
color_id = 2
color_name = red
total = 47
But I would like to bring the other colors, only with total = 0, respectively.
How it can be implemented?