I have an object Project__c where I have related list as Phase__c and Toll__c. Project__c is a lookup to Phase__c and Toll__c.Can i have a single soql query where i can have all the phase__c and toll__c under each project.


1 Answer 1


Use below query,

List<Project__c> lstProject=[Select id,(select id from Phases__r),(select id from Tolls__r) from Project__c];

Note - Phases & Tolls are the child relationship names. You need to update them if you have given some different child relationship names.

  • @Sid did it work?
    – snehakem
    Commented Apr 17, 2015 at 5:15

You must log in to answer this question.

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