左连接FetchXml?

时间:2010-07-10 08:40:31

标签: dynamics-crm dynamics-crm-4 fetchxml

如何使用FetchXml进行左连接?

考虑一个简单的SQL查询,如下所示:

select person.name, address.city from person
left join address on person.addressid = address.addressid

如何使用FetchXml完成这样的简单操作? 目前,我的FetchXml查询如下所示:

<fetch mapping='logical'>
  <entity name='person'>
    <attribute name='name' />
    <link-entity name='address' from='addressid' to='addressid'>
      <attribute name='city' />
    </link-entity>
  </entity>
</fetch>

1 个答案:

答案 0 :(得分:10)

像这样更新<link-entity>

<link-entity name='address' from='addressid' to='addressid' link-type='outer'>