CRM-14012 - need to do a group by to mitigate the left joins