获取与特定机会相关的个人帐户

huangapple go评论71阅读模式
英文:

Fetching person account related to a specific opportunity

问题

这是我的SOQL查询:

SELECT Id, Name, (SELECT Id, Name FROM Opportunities WHERE Id='{pv0}') FROM Account WHERE IsPersonAccount=True

它返回所有的个人账户,如何将其过滤为仅特定的机会记录?

英文:

I got an opportunity where I want to fetch the related person account on it

This is my soql:

SELECT Id, Name, (SELECT Id, Name FROM Opportunities WHERE Id='{pv0}') FROM Account WHERE IsPersonAccount=True

It returns all the Person Account, how can I filter it to just an specific opp record?

答案1

得分: 0

select id, name
from account
where id in (select accountid from opportunity where id='006...')

英文:
select id, name
from account
where id in (select accountid from opportunity where id='006...')

huangapple
  • 本文由 发表于 2023年2月24日 15:42:47
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553792.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定