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
sreenivas_cippyalisreenivas_cippyali 

is this correct query... its showing error like--------> unexpected token: '['

accountname = [select id,name,[select id, firstname from contact] from account];

kiranmutturukiranmutturu

list<account> accountname = [select id,name,(select id, firstname from contact) from account];

Richie DRichie D

Slight update - you need to use the plural to get the related contacts:-

 

list<account> accountname = [select id,name,(select id, firstname from contacts) from account];

Abhay AroraAbhay Arora

accountname = [select id,name,(select id, firstname from contacts) from account];

 

please mark this as solved if above is what you need