Non ti serve un distinct ma una clausola where però dovrei sapere cosa deve fare la query e come sn fatte le tabelle