You need to sign in to do that
Don't have an account?
Varun kumar Saxena
General Collections queries
Guys ,
Can anyone tell me where I mean which list type or list is used to store the below Query .
select Id , (select Id, Name from Contacts) from Account .
Can anyone tell me where I mean which list type or list is used to store the below Query .
select Id , (select Id, Name from Contacts) from Account .
A SOQL query will always return a list of sobjects even if a COUNT method is used If you are assigning a query to a single sobject Apex will execute your query then attempt to assign to this sobject (unfortunately, if there are no elements in the returned query or more than one you will get an exception).
Please mark this as the best answer if this helps
All Answers
A SOQL query will always return a list of sobjects even if a COUNT method is used If you are assigning a query to a single sobject Apex will execute your query then attempt to assign to this sobject (unfortunately, if there are no elements in the returned query or more than one you will get an exception).
Please mark this as the best answer if this helps
accountList[0].Contacts
Do mark it as best answer if it helped.
There is one more requirement , suppose if I want to debug the name of the contact from the above SOQL parent to child query , then what should I practice to get the solution