+ Start a Discussion
Chris987654321Chris987654321 

Nested Queries

I have a nested query that looks like this:

 

sectionList = [SELECT Id,
Section__c.Column_Count__c,
Section_Number__c,
Section_Header__c,
(Select i.Type__c,
i.Spacer_Height__c,
i.Section__c,
i.Required__c,
i.Read_Only__c,
i.Object_Name__c,
i.Field_Name__c,
i.Display_Label__c,
i.Display_Label_Location__c,
i.Dependency_Required_for_Value__c,
i.Dependency_Field__c,
i.Content__c,
i.Column_Number__c
from Items__r i order by i.Column_Row_Number__c )
from Section__c ];

 

 I am getting an error "Inline query has too many rows for direct assignment, use FOR loop". My question is when you use nested queries like this, how many rows will it return?

 

For instance let's say there were 10 Section__c records and each section had 5 Item__c records. Would the query return 50 records or just 10?