Hello, the error now is that it is adding the CodSetor. The values would be 6 and 3, however 6 and 6 are coming. Follow photos and codes.
SELECT *, COUNT('funcionario'.'funcionario_CodSetor') AS total
FROM 'funcionario'
JOIN 'setor' ON 'setor'.'CodSetor' = 'funcionario'.'funcionario_CodSetor'
JOIN 'horario' ON 'horario'.'horario_CodSetor' = 'funcionario'.'funcionario_CodSetor'
JOIN 'cbo' ON 'cbo'.'CodCBO' = 'funcionario'.'funcionario_CodCBO'
JOIN 'familiacbo' ON 'familiacbo'.'CodFamilia' = 'cbo'.'cbo_CodFamilia'
WHERE 'funcionario_CodEmpresa' = '32'
GROUP BY 'funcionario'.'funcionario_CodSetor'
Without the join in the schedule of the sector is normal