📌  相关文章
📜  从帐户中选择 id、姓名、(从联系人中选择 id)(从机会中选择 id) - 无论代码示例

📅  最后修改于: 2022-03-11 14:55:14.750000             🧑  作者: Mango

代码示例1
List accounts = [SELECT Id, Name, (SELECT id FROM Contacts), (SELECT id FROM opportunities) FROM Account];

for (Account a : accounts) {
     System.debug('Count of Opportunities is ' + a.Opportunities.size());
     System.debug('Count of Contacts is ' + a.Contacts.size());
}