Left join in FetchXml?

本秂侑毒 提交于 2019-12-10 15:28:49

问题


How do i do a left join using FetchXml?

Consider a simple SQL query like the following:

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

How would something simple like this be done using FetchXml? Currently my FetchXml query looks like the following:

<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:


Update your <link-entity> like so:

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


来源:https://stackoverflow.com/questions/3218510/left-join-in-fetchxml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!