distinct will return duplicate entries and cause primary key related errors, group by will assure unique ones