<?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>idea Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery) in ArcGIS Pro Ideas</title>
    <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idi-p/1240170</link>
    <description>&lt;P&gt;ArcGIS Pro 3.0.3; mobile geodatabase.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a definition query on a standalone table:&lt;/P&gt;&lt;PRE&gt;OBJECTID IN (3, 5, 11)&lt;/PRE&gt;&lt;P&gt;In a FC, I create a join to the table with the definition query (join: ASSET_ID=ASSET_ID). The definition query gets applied to the joined FC, and the OBJECTID gets automatically prefixed with the table name:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;main.RoadInspTable.&lt;/STRONG&gt;&lt;/FONT&gt;OBJECTID IN (3, 5, 11)&lt;/PRE&gt;&lt;P&gt;That works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I do the same thing, but this time using a more complex definition query, one that has a subquery:&lt;/P&gt;&lt;PRE&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Use case for the complex definition query: &lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/one-to-first-joins-control-what-related-record-is/idc-p/1239993/highlight/true#M22488" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-ideas/one-to-first-joins-control-what-related-record-is/idc-p/1239993/highlight/true#M22488&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I go to create the join, I use the Validate Join tool first. The join is valid.&lt;/P&gt;&lt;P&gt;But when I create the join, it fails:&lt;/P&gt;&lt;PRE&gt;Failed to refresh table. &lt;BR /&gt;Error: &lt;BR /&gt;Underlying DBMS error [ambiguous column name:&lt;BR /&gt;objectid] [Roads][STATE_ID = 0]&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1670858426159.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58291iEA7F48AC92570C39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1670858426159.png" alt="Bud_0-1670858426159.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The problem is: ArcGIS Pro hasn't given OBJECTID a prefix in the joined FC's definition query.&lt;/P&gt;&lt;P&gt;How it is:&lt;/P&gt;&lt;PRE&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;How it should be:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;roadinsptable.&lt;/STRONG&gt;&lt;/FONT&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;If I manually add the prefix to the joined FC's definition query, then it works as expected. The error goes away.&lt;/P&gt;&lt;P&gt;But it took some time to figure out why that was happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since prefixes already get added to columns in simple definition queries, could the same thing happen for more complex definition queries? (ones with subqueries like above)&lt;/P&gt;&lt;P&gt;That would avoid some headache.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 22 Mar 2023 13:54:22 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2023-03-22T13:54:22Z</dc:date>
    <item>
      <title>Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idi-p/1240170</link>
      <description>&lt;P&gt;ArcGIS Pro 3.0.3; mobile geodatabase.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have a definition query on a standalone table:&lt;/P&gt;&lt;PRE&gt;OBJECTID IN (3, 5, 11)&lt;/PRE&gt;&lt;P&gt;In a FC, I create a join to the table with the definition query (join: ASSET_ID=ASSET_ID). The definition query gets applied to the joined FC, and the OBJECTID gets automatically prefixed with the table name:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;main.RoadInspTable.&lt;/STRONG&gt;&lt;/FONT&gt;OBJECTID IN (3, 5, 11)&lt;/PRE&gt;&lt;P&gt;That works as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I do the same thing, but this time using a more complex definition query, one that has a subquery:&lt;/P&gt;&lt;PRE&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;&lt;EM&gt;Use case for the complex definition query: &lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/one-to-first-joins-control-what-related-record-is/idc-p/1239993/highlight/true#M22488" target="_blank" rel="noopener"&gt;https://community.esri.com/t5/arcgis-pro-ideas/one-to-first-joins-control-what-related-record-is/idc-p/1239993/highlight/true#M22488&lt;/A&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I go to create the join, I use the Validate Join tool first. The join is valid.&lt;/P&gt;&lt;P&gt;But when I create the join, it fails:&lt;/P&gt;&lt;PRE&gt;Failed to refresh table. &lt;BR /&gt;Error: &lt;BR /&gt;Underlying DBMS error [ambiguous column name:&lt;BR /&gt;objectid] [Roads][STATE_ID = 0]&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1670858426159.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/58291iEA7F48AC92570C39/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bud_0-1670858426159.png" alt="Bud_0-1670858426159.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The problem is: ArcGIS Pro hasn't given OBJECTID a prefix in the joined FC's definition query.&lt;/P&gt;&lt;P&gt;How it is:&lt;/P&gt;&lt;PRE&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;How it should be:&lt;/P&gt;&lt;PRE&gt;&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;roadinsptable.&lt;/STRONG&gt;&lt;/FONT&gt;objectid IN (
     SELECT objectid
       FROM roadinsptable r2
      WHERE r2.asset_id = roadinsptable.asset_id
   ORDER BY date_ DESC, condition DESC
      LIMIT 1
            )&lt;/PRE&gt;&lt;P&gt;If I manually add the prefix to the joined FC's definition query, then it works as expected. The error goes away.&lt;/P&gt;&lt;P&gt;But it took some time to figure out why that was happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since prefixes already get added to columns in simple definition queries, could the same thing happen for more complex definition queries? (ones with subqueries like above)&lt;/P&gt;&lt;P&gt;That would avoid some headache.&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 13:54:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idi-p/1240170</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-22T13:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1247505#M22802</link>
      <description>&lt;P&gt;Thanks for bringing this to our attention&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/351335"&gt;@Bud&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can reproduce your error, and after some discussion with the team, have decided this would be better marked with the Geoprocessing label.&amp;nbsp; I've changed it and brought it to the attention of the correct team.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Again.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2023 23:56:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1247505#M22802</guid>
      <dc:creator>SSWoodward</dc:creator>
      <dc:date>2023-01-11T23:56:45Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1255472#M23171</link>
      <description>&lt;P&gt;Screen recording video (ignore the video title; this video demonstrates multiple issues; I used it in multiple posts):&lt;/P&gt;&lt;P&gt;&lt;div class="lia-vid-container video-embed-center"&gt;&lt;div id="lia-vid-6319892805112w766h540r16" class="lia-video-brightcove-player-container"&gt;&lt;video-js data-video-id="6319892805112" data-account="6161463677001" data-player="default" data-embed="default" class="vjs-fluid" controls="" data-application-id="" style="width: 100%; height: 100%;"&gt;&lt;/video-js&gt;&lt;/div&gt;&lt;script src="https://players.brightcove.net/6161463677001/default_default/index.min.js"&gt;&lt;/script&gt;&lt;script&gt;(function() {  var wrapper = document.getElementById('lia-vid-6319892805112w766h540r16');  var videoEl = wrapper ? wrapper.querySelector('video-js') : null;  if (videoEl) {     if (window.videojs) {       window.videojs(videoEl).ready(function() {         this.on('loadedmetadata', function() {           this.el().querySelectorAll('.vjs-load-progress div[data-start]').forEach(function(bar) {             bar.setAttribute('role', 'presentation');             bar.setAttribute('aria-hidden', 'true');           });         });       });     }  }})();&lt;/script&gt;&lt;a class="video-embed-link" href="https://community.esri.com/t5/video/gallerypage/video-id/6319892805112"&gt;(view in My Videos)&lt;/a&gt;&lt;/div&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Feb 2023 21:17:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1255472#M23171</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-02-06T21:17:28Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1257527#M23285</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Canada Case #03258894&lt;BR /&gt;ArcGIS Pro 3.0.3 — Validate Join passes, but resulting join has error&lt;/P&gt;&lt;P&gt;BUG-000155819: Attribute table of joined layer in Mobile Geodatabase does not open when a definition query with a subquery is applied to the join table.&lt;/P&gt;&lt;P&gt;...The join will only determine if the join is valid, which in this case it is. There are matching records in both the input table and the join table. Ultimately the issue is with the attribute table itself. There is some misconfiguration in either the way Pro is sending the subquery nested within the join query or the way the database is interpreting the subquery.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Mon, 13 Feb 2023 15:01:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1257527#M23285</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-02-13T15:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1270382#M23890</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/129401"&gt;@KoryKramer&lt;/a&gt;&amp;nbsp;Feel free to close, since support confirmed this is a bug.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Mar 2023 13:56:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1270382#M23890</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2023-03-22T13:56:36Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery) - Status changed to: Closed</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1271049#M23945</link>
      <description>&lt;P&gt;Closed as a bug. Users experiencing this issue can follow&amp;nbsp;&lt;A href="https://support.esri.com/en-us/bug/the-attribute-table-of-a-joined-layer-in-a-mobile-geoda-bug-000155819" target="_blank"&gt;https://support.esri.com/en-us/bug/the-attribute-table-of-a-joined-layer-in-a-mobile-geoda-bug-000155819&lt;/A&gt;&amp;nbsp;for status updates.&lt;/P&gt;</description>
      <pubDate>Thu, 23 Mar 2023 18:17:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1271049#M23945</guid>
      <dc:creator>KoryKramer</dc:creator>
      <dc:date>2023-03-23T18:17:48Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1386451#M28670</link>
      <description>&lt;P&gt;Possibly related:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Article ID:000002957&lt;/SPAN&gt;&amp;nbsp;- ArcMap&lt;/P&gt;&lt;P&gt;&lt;A href="https://support.esri.com/en-us/knowledge-base/features-do-not-draw-after-joining-data-to-a-layer-with-000002957" target="_self"&gt;Features do not draw after joining data to a layer with a definition query&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Feb 2024 16:15:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1386451#M28670</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-02-24T16:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Join to table with definition query — column name should get prefixed with table name (SQL expression with subquery)</title>
      <link>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1526059#M31704</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/351335"&gt;@Bud&lt;/a&gt;&amp;nbsp;Yes the above KB article is relevant for ArcMap.&amp;nbsp; For Pro 3.2+, this has been fixed.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Aug 2024 18:45:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-ideas/join-to-table-with-definition-query-column-name/idc-p/1526059#M31704</guid>
      <dc:creator>JonathanNeal</dc:creator>
      <dc:date>2024-08-22T18:45:11Z</dc:date>
    </item>
  </channel>
</rss>

