如何使用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>
答案 0 :(得分:10)
像这样更新<link-entity>
:
<link-entity name='address' from='addressid' to='addressid' link-type='outer'>