← All questions
ApexMedium
SOQL relationship query result
What does this query return for an Account that has three related Contacts?
Account a = [SELECT Name,
(SELECT LastName FROM Contacts)
FROM Account
WHERE Id = :accountId];
System.debug(a.Contacts.size());