distinct will return duplicate entries and cause primary key related err...

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