I have a problem in counting by MySQL in a GROUP BY
This is the query that does not return the desired result.
SELECT COUNT(bagno)
FROM disposizione_assegnazione_pezze
JOIN pezze
ON pezza = id
WHERE id_prodotto_tessuto = 12096
AND id_collezione = 11
AND id_stagione = 22
AND id_tema = 1
GROUP BY bagno
The result of the count is 3
This is the pezza
table and its primary key is id
This is the table disposizione_assegnazione_pezze
that has the pezza
column which refers to the previous table
Why does not return 1 as a result my query?
Question of the problem
I want to count how many different bagno
are there