la DISTINCT sulla seconda tabella potrebbe riportarti un NULL, il che potrebbe falsare i risultati. controlla