Salesforce SOQL 返回单个帐户的所有合作伙伴

发布于 2024-11-13 05:52:50 字数 307 浏览 4 评论 0原文

我正在尝试查找具有同一合作伙伴的所有帐户。我是 SOQL 新手,无法进行连接,所以我不知所措。这是我得到的最接近的结果:

Select Name, Site, Status__c
FROM Account 
WHERE Account.Id = Partner.AccountToId 
AND Partner.AccountFromId = '0013000000bF5rtABC'

这不起作用。也许我的大脑无法正常工作,但我就是无法弄清楚这一点。我需要提取与“0013000000bF5rtABC”(或任何帐户)合作的所有帐户。

I am trying to find all the account that have the same partner. I am new to SOQL and I cannot do a join so I am at a loss. Here is the closest I have gotten:

Select Name, Site, Status__c
FROM Account 
WHERE Account.Id = Partner.AccountToId 
AND Partner.AccountFromId = '0013000000bF5rtABC'

This does not work. Perhaps my brain is not functioning, but I just cant figure this out. I need to pull all of the account who are partners with '0013000000bF5rtABC' (or whatever account).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

暖阳 2024-11-20 05:52:50

以下查询将返回与 0013000000bF5rtABC 合作的所有账户。在 Salesforce 中,您需要使用内部查询的概念来执行联接。

Select Name, Site, Status__c
FROM Account 
where ID IN 
(Select AccountToId from Partner where AccountFromId = '0013000000bF5rtABC')

Below query will return all accounts who are partners with 0013000000bF5rtABC. In salesforce you need to use concept of inner queries to perform join.

Select Name, Site, Status__c
FROM Account 
where ID IN 
(Select AccountToId from Partner where AccountFromId = '0013000000bF5rtABC')
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文