SOQL join between two standard objects

All i want to do is to retrieve information from two standard objects Account and Case. For I have tried joins(which later I found does not work with SOQL), relationships (which does not exist in my case. except for default relationship). Following is another attempt using sub query: (By default relationship I mean that Id in Account is same as AccountId in Case)

Select Phone,City__c,CreatedDate,Name, (SELECT Customer_Satisfaction_Level__c,Product_Category__c FROM AccountId__r) 
FROM Account;

Also, SOQL does not allow aliases which would have helped me as I am working with QlikView. Please Help!

P.S: i want names from account and the case detail from cases. hence, a join between the two.


You can try querying the Case object and using dot notation to get to the Account info:

SELECT Account.Id, Account.Name, Id, Description from Case

Source : Link , Question Author : Salik , Answer Author : Daniel Hoechst

Leave a Comment