select distinct with left join