function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
reddygari403reddygari403 

find the answer

 Minimum number of queries required to query for 2 level, 3 level relationships in salesforce

bob_buzzardbob_buzzard

If by 2 level you mean a parent and children, you can do this in a single query, although it contains a subquery that counts as another SOQL query for governor limits purposes.  3 levels you'd need to use two queries, one of which would contain a subquery.