Good morning, I'm new here and I have a boring problem. Distinct does not solve my problem because the duplication is due to the fact that I had to make the relationship with other tables to look for information. I have a SQL statement that I want to display in SQL Server 2005.
SELECT ch.idchamado,su.nome AS nomesupervisor,
e.nome,
ch.dataabertura,
ch.datafechamento,
ta.desctipoassunto
FROM sase_chamado ch
LEFT JOIN vw_app_consulta_escolas e
ON ch.idpj = e.idpessoa_juridica
LEFT JOIN sase_tipoassunto ta
ON ta.idtipoassunto = ch.idtipoassunto
LEFT JOIN sase_escolasusuario eu
ON eu.idpj = ch.idpj
INNER JOIN sase_usuario su
ON eu.idusuario = su.idusuario
WHERE ch.dataabertura BETWEEN to_date('01/01/16', 'dd/mm/yy') AND to_date('30/07/16', 'dd/mm/yy')
ORDER BY su.nome,
e.nome,
ta.desctipoassunto
The darn of duplicity is of this type here: