I need to access the fields from the nested Select statement. Here is the code
Select Name, id, (SELECT id FROM Account.Contacts)
from Account where id = '0011a000004eVlYAAU'
How do I access the "id" from "Account.Contacts". I found an answer but I am not able to make it work.
For(string b : [Select Name, id, (SELECT id FROM Account.Contacts)
from Account where id = '0011a000004eVlYAAU'])
{
system.debug(b.Account.Contacts);
}