Il distinct si estende a tutti i campi che includi nella select. Prova ad usare group by.