<?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: Query Layer is returning branch version history in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710023#M103765</link>
    <description>&lt;P&gt;This article has examples for branch version SQL views:&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-utility-network-documents/branch-version-sql-views-utility-network/ta-p/1200811" target="_blank"&gt;https://community.esri.com/t5/arcgis-utility-network-documents/branch-version-sql-views-utility-network/ta-p/1200811&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 25 Jun 2026 19:31:50 GMT</pubDate>
    <dc:creator>tmichael_wpjwa</dc:creator>
    <dc:date>2026-06-25T19:31:50Z</dc:date>
    <item>
      <title>Query Layer is returning branch version history</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1709969#M103759</link>
      <description>&lt;P&gt;I know I'm missing something obvious. I created a query layer with a subquery to show poles that have associated records in my sign table. Because the pole feature class is branch versioned, the SQL query is returning as many as five records for a single pole because there is historical data sitting in the table. AI suggested adding the where clause GDB_IS_DELETE = 0, but still returns multiple records for the same pole.&lt;/P&gt;&lt;P&gt;I remember a while back needing to write these queries against the _EVW table, but maybe that was traditional versioning?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 18:00:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1709969#M103759</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2026-06-25T18:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: Query Layer is returning branch version history</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710005#M103764</link>
      <description>&lt;P&gt;This is what I had to use to create a database view in SQL Server for one of my branch version feature classes to return the "parent" record. It just worked in a query layer for me.&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;SELECT OBJECTID, SHAPE, FIELD1, FIELD2, FIELD3 
FROM SCHEMA.TABLENAME
WHERE FIELD1 = 'INSERTFIELDTEXTHERE' AND SCHEMA.TABLENAME.GDB_ARCHIVE_OID IN
  (Select MB_.GDB_ARCHIVE_OID
   From
     (SELECT GDB_ARCHIVE_OID,
         ROW_NUMBER() OVER (PARTITION BY OBJECTID
         ORDER BY gdb_from_date DESC) rn, gdb_is_delete
      FROM SCHEMA.TABLENAME
	  WHERE (gdb_branch_id = 0 AND
              gdb_from_date &amp;lt;= '12.31.9999 23:59:59.000')) MB_
    WHERE rn = 1 AND gdb_is_delete = '0' )&lt;/LI-CODE&gt;&lt;P&gt;I wish I could remember who originally posted this SQL because I definitely did not figure this out on my own.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 19:11:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710005#M103764</guid>
      <dc:creator>Joshua-Young</dc:creator>
      <dc:date>2026-06-25T19:11:23Z</dc:date>
    </item>
    <item>
      <title>Re: Query Layer is returning branch version history</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710023#M103765</link>
      <description>&lt;P&gt;This article has examples for branch version SQL views:&lt;BR /&gt;&lt;A href="https://community.esri.com/t5/arcgis-utility-network-documents/branch-version-sql-views-utility-network/ta-p/1200811" target="_blank"&gt;https://community.esri.com/t5/arcgis-utility-network-documents/branch-version-sql-views-utility-network/ta-p/1200811&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 19:31:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710023#M103765</guid>
      <dc:creator>tmichael_wpjwa</dc:creator>
      <dc:date>2026-06-25T19:31:50Z</dc:date>
    </item>
    <item>
      <title>Re: Query Layer is returning branch version history</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710033#M103766</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/313283"&gt;@Joshua-Young&lt;/a&gt;&amp;nbsp;- thank you. I had to add that long WHERE clause twice - once to get the "parent" table for the point feature class and once to get the "parent" table for the table I was joining to the point feature class. But it worked and the count FINALLY matches what I expected.&lt;BR /&gt;&lt;BR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/633033"&gt;@tmichael_wpjwa&lt;/a&gt;&amp;nbsp;- Thank you for that link.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Jun 2026 19:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/query-layer-is-returning-branch-version-history/m-p/1710033#M103766</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2026-06-25T19:46:42Z</dc:date>
    </item>
  </channel>
</rss>

