Good afternoon Personal, someone can tell me why this query does not work. Actually it works, but it brings the values in the wrong way (duplicating the department field), as if distinct did not work.
select distinct r.departamento, s.status,
count(s.status) as quantidade from sac as s
inner join responsaveis as r on s.id_sac =
r.sac_id where r.departamento = 1 and s.status_sac = 1