2

我正在尝试在 fetchXML 中建立 2 个左外连接。我可以完成这个sql语句吗...

select
a.new_campaignid
, a.new_ContactId
, b.new_campaigncontactstatusId
from
new_ContactCampaignNN AS a 
    left outer join new_campaigncontactstatus AS b ON a.new_contactid = b.new_ContactId 
        AND a.new_campaignid = b.new_CampaignId

进入这样的 fetchXML 语句?

<fetch mapping='logical' distinct='true'>
  <entity name='new_contactcampaignnn'>
    <attribute name='new_campaignid' />
    <attribute name='new_contactid' />
    <filter type='and'>
      <condition attribute ='new_campaignid' operator='eq' value='72C9284B-905D-E111-9847-002655325864'/>
    </filter>
    <link-entity name='new_campaigncontactstatus' from='new_contactid' to='new_contactid' visible='true' link-type='outer' alias='new_contactcampaignnn_new_campaigncontactstatus'>
      <attribute name='new_campaigncontactstatusid' />
      <link-entity name='new_contactcampaignnn' from='new_campaignid' to='new_campaignid' visible='true' link-type='outer' alias='new_contactcampaignnn_new_campaigncontactstatus1'></link-entity>
    </link-entity>
  </entity>
</fetch>
4

1 回答 1

0

我认为LINQtoCRM可以做到这一点,您可能也可以使用LinqPad进行探索。

于 2012-06-28T09:48:48.627 回答