This query gives me repeated data, and I want to give a distinct to the result of it. help me please, thanks in advance.
SELECT DISTINCT c.*, IF (c.code = 'FF', "INICIO" , "-") AS PARTIDA,
IF(re.code_enlace = 'FF', CONCAT("INVITADO DE ", r.code_enlace),
CONCAT("INVITADO DE", c.code)) AS INVITADO_POR FROM clientes c,
relacion r, relacion re WHERE r.code_enlace = 'FF' AND ((c.code =
r.code OR c.code = 'FF') OR (re.code_enlace = r.code AND c.code =
re.code)) ORDER BY PARTIDA DESC, INVITADO_POR ;