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.

2 Answers 2


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
  • nope, had tried it earlier. I believe that the problem is with using the connector I have installed to integrate QlikView and Salesforce. It does not allow me to use subquery as well as the query you shared.
    – Salik
    Nov 13, 2013 at 4:21
  • I would recommend contacting QlikView support. SOQL provides several ways to get to the data you need, I'd think QlikView would do what you need to do. Nov 13, 2013 at 4:30
  • Could you tell me one last thing? Using objec reference of Account as in Account.Id or Account.Name. Both of these references return one field/value? Or does it return a list/array of other attributes? Because i tried your query and instead of fetching two different fields, it fetched one field by the name of Account.
    – Salik
    Nov 13, 2013 at 5:07
  • It returns the object with the selected fields populated. How you view it depends on the tool you are using to query. In Developer Console, you can see each value. In some of the other tools like Workbench, I think it shows just a reference to the Account. Nov 13, 2013 at 6:03

You need to use a correct child relationship name Cases

Select Id, Name, (Select Id, Description From Cases) 
From Account

Like the documentation says (Relationship Queries):

For parent-to-child relationships, the parent object has a name for the child relationship that is unique to the parent, the plural of the child object name. For example, Account has child relationships to Assets, Cases, and Contacts among other objects, and has a relationshipName for each, Assets, Cases, and Contacts.

  • I am doing this in QlikView, and it is not allowing me to execute sub-queries apparently. it gives me an error : Unexpected token '( '
    – Salik
    Nov 12, 2013 at 12:19
  • 2
    Try workbench or the Developer Console.
    – Mike Chale
    Nov 12, 2013 at 13:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .