<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Join with definition query excludes row unexpectedly in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/join-with-definition-query-excludes-row/m-p/1540549#M88454</link>
    <description>&lt;P&gt;It appears to be a bug.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Esri Case #03704340 - ArcGIS Pro 3.3.1 - Join with definition query excludes row unexpectedly&lt;/P&gt;&lt;P&gt;BUG-000170869: Adding a definition query &lt;STRONG&gt;excludes a row of data&lt;/STRONG&gt; when using Add Join geoprocessing tool in ArcGIS Pro&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 18:14:21 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-09-19T18:14:21Z</dc:date>
    <item>
      <title>Join with definition query excludes row unexpectedly</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-with-definition-query-excludes-row/m-p/1540547#M88453</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.3.1; mobile geodatabase or file geodatabase&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mobile Geodatabase:&lt;/P&gt;&lt;P&gt;I have TABLE_A:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1726769093166.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115471i70AC8DB7A33DD105/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1726769093166.png" alt="Bud_0-1726769093166.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;And TABLE_B:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1726769109937.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115472iCC7EB0D927BE7E32/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1726769109937.png" alt="Bud_1-1726769109937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I've hidden the OBJECTID fields from both attribute tables to remove visual clutter.&lt;/P&gt;&lt;P&gt;I want to join from TABLE_A to TABLE_B using the common ID fields. I want the join relationship to be one-to-first, not one-to-many. When it comes to "what related record to use from the join table" in the one-to-first join, I want to use the rows from TABLE_B where BINARY =&amp;nbsp;1.&lt;/P&gt;&lt;P&gt;Background: &lt;A href="https://community.esri.com/t5/data-management-questions/1-m-join-to-pull-feature-with-specific-attribute/m-p/1524843/highlight/true#M45338" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/data-management-questions/1-m-join-to-pull-feature-with-specific-attribute/m-p/1524843/highlight/true#M45338&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I apply a definition query to TABLE_B: &lt;FONT face="courier new,courier" color="#0000FF"&gt;WHERE BINARY = 1&lt;/FONT&gt;.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_2-1726769130324.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115474i1433016282BEE554/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_2-1726769130324.png" alt="Bud_2-1726769130324.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Then I create the join:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_3-1726769163295.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115475iC6CDE6F0DA097CF2/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_3-1726769163295.png" alt="Bud_3-1726769163295.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But, due to the definition query being applied to the join, the row from TABLE_A where ID_A=3 has been excluded. That is expected since there is no matching row in TABLE_B where the ID is 3.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_4-1726769189346.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115476i34795944855A4514/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_4-1726769189346.png" alt="Bud_4-1726769189346.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So, I will modify the definition query on the joined table to include ...&lt;FONT face="courier new,courier" color="#0000FF"&gt;&lt;STRONG&gt;OR ID_B IS NULL&lt;/STRONG&gt;.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;However, the new definition query excludes the row where ID_A=1. That's not expected.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_5-1726769209228.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115477i95D7157294796D33/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_5-1726769209228.png" alt="Bud_5-1726769209228.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Definition Query:&lt;FONT face="courier new,courier" color="#0000FF"&gt; main.TABLE_B.BINARY = 1 OR main.TABLE_B.ID_B IS null&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;I expected the attribute table of the join to look like this (using DBeaver 23.3.2 SQL client):&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_6-1726769228187.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/115478iF0EB65D57AF7CEB2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_6-1726769228187.png" alt="Bud_6-1726769228187.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;select
    a.id_a,
    b.id_b,
    b.binary
from
    table_a a
left join
    table_b b   
    on a.id_a = b.id_b
where
    binary=1 or id_b is null
order by
    id_a&lt;/PRE&gt;&lt;P&gt;Question:&lt;/P&gt;&lt;P&gt;Why is the one-to-first join with the definition query&amp;nbsp;&amp;nbsp;&lt;FONT face="courier new,courier" color="#0000FF"&gt;main.TABLE_B.BINARY = 1 OR main.TABLE_B.ID_B IS null&lt;/FONT&gt;&amp;nbsp; excluding the row where ID_A=1?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 18:15:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-with-definition-query-excludes-row/m-p/1540547#M88453</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-09-19T18:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Join with definition query excludes row unexpectedly</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/join-with-definition-query-excludes-row/m-p/1540549#M88454</link>
      <description>&lt;P&gt;It appears to be a bug.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Esri Case #03704340 - ArcGIS Pro 3.3.1 - Join with definition query excludes row unexpectedly&lt;/P&gt;&lt;P&gt;BUG-000170869: Adding a definition query &lt;STRONG&gt;excludes a row of data&lt;/STRONG&gt; when using Add Join geoprocessing tool in ArcGIS Pro&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 18:14:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/join-with-definition-query-excludes-row/m-p/1540549#M88454</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-09-19T18:14:21Z</dc:date>
    </item>
  </channel>
</rss>

