I want to show accounts and contacts data of a particular case in a form. how can i query the same using soql query in salesforce. I have a custom object named Work_Order__c which is having a master-detail relationship with CASE object. I am trying to write a below mentioned query, but the inner query is giving error.
select Id,Case__r.CaseNumber,Case__r.Description,Name, Status__c,Priority__c,Description__c,City__c,Street__c,Zip__c, (select Case__r.Account.Name, Case__r.Contact.Name from Work_Orders__r) from Work_Order__c where Id = 'a024B0000025L6G'