My SQL query is returning multiple rows with the same id following:
SELECT distinct (c.nome), c.id, c.email,c.telefone1,c.telefone2,
SUM(a.valor) AS "valorDaCompra",u.id AS "idLoja",u.nome AS "nomeLoja",
SUM(a.qtd_pecas) AS "qtdPecasCompradas", a.data_hora as "dataHora",
c.data_hora as "dataCadastro"
FROM cliente as c
INNER JOIN atendimento AS a
ON a.id_cliente = c.id INNER JOIN usuario AS u
ON a.id_loja = u.id
WHERE a.id_empresa= 843
AND a.id_loja IN (2855)
AND a.venda = true
GROUP BY a.data_hora, c.id,a.id_cliente,u.id,c.data_hora
HAVING SUM(a.valor) >= 2 AND SUM(a.valor) <= 20000
ORDER BY c.id DESC