I have a custom Commission table which has a master detail relationship with contact. I have a List of AccountIds being passed into the function and then into the query. I'm getting the error: " Didn't understand relationship 'Contacts' in FROM part of query call" Any help would be great.
List<Commission__c> comList2 = [SELECT commission_amount__c, date_given__c,
(SELECT Id FROM Contacts WHERE AccountId in : accountIds)
FROM Commission__c];
SELECT commission_amount__c, date_given__c, Contact__r.Name, Contact__r.Email
FROM Commission__c
WHERE Contact__r.AccountId IN :accountIds