List<Opportunity_Payment__c> opp = [SELECT Id,(SELECT Owner.Id FROM Opportunity__r) FROM Opportunity_Payment__c];
- Opportunity_Payment__c has master-detail relationship field to the opportunity.
**ERROR: **Didn't understand relationship 'Opportunity__r' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.