<?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: SQL: Select first row of duplicates (RESOLVED) in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100455#M45835</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/187313"&gt;@LauraGiboo&lt;/a&gt;, as I mention in an earlier comment, the SQL that is supported with the Select By ... tools varies depending on back-end data store. What is the back-end data store, file geodatabase?&lt;/P&gt;</description>
    <pubDate>Tue, 21 Sep 2021 17:11:36 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2021-09-21T17:11:36Z</dc:date>
    <item>
      <title>SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005868#M34645</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Edit: I was able to accomplish my objective by summarizing my field, joining it back to the original dataset and selecting my desired rows that way. Thank you everyone for responding to my post.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Happy December everyone!&lt;/P&gt;&lt;P&gt;Could anyone suggest me a chunk of SQL code to use in Select by Attributes to select only the first row of each group of duplicates? Or select a duplicate that associated with another column's max value?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Objective:&lt;/P&gt;&lt;P&gt;I have a table of 520,000 census block codes that include broadband download speeds. I have the table sorted by Census Blocks (Ascending) and then by download speeds (Descending) to list the census blocks in the order of highest download speed to the lowest (each group of duplicate census blocks are ordered from highest to lowest download speeds).&lt;/P&gt;&lt;P&gt;Because there are duplicates of each census block, I only want to select the census block with the highest download speed. I have the table sorted where the first census block code of each group of duplicates has the highest download speed.&lt;/P&gt;&lt;P&gt;My goal is to select each block code with the highest download speed. The data is stored in a file geodatabase&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;&lt;STRONG&gt;Block Code&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;&lt;STRONG&gt;Download Speed&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234 (row to select)&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;5678 (row to select)&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;5678&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jamie&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Edit: I do not have access to Delete Identical/Find Identical Tools&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 18:06:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005868#M34645</guid>
      <dc:creator>JamieHoffmann</dc:creator>
      <dc:date>2020-12-01T18:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005873#M34646</link>
      <description>&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/find-identical.htm" target="_blank"&gt;Find Identical (Data Management)—ArcGIS Pro | Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;you can use a single or multiple fields to determine how identical, identical is&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:02:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005873#M34646</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-12-01T16:02:44Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005875#M34647</link>
      <description>&lt;P&gt;I forgot to mention that I do not have the license for that tool. Thanks for the reply!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:05:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005875#M34647</guid>
      <dc:creator>JamieHoffmann</dc:creator>
      <dc:date>2020-12-01T16:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005880#M34648</link>
      <description>&lt;P&gt;For SQL, you can may also be able to use SELECT DISTINCT [field] FROM [table] ORDER BY ID. Adjust to your situation.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:12:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005880#M34648</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2020-12-01T16:12:03Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005892#M34650</link>
      <description>&lt;P&gt;Regarding&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/71663"&gt;@JamieHoffmann&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;I have a table of 1000 internet providers. Lets say three rows are listed Comcast, Comcast, Comcast. I only want to select the first of the three that appears in the table.&amp;nbsp;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I think it is better stated that you only want to select one of them, not selecting the "first" because there is no first if the records are truly duplicates.&amp;nbsp; If you want to select first based on OID, then it would be important to state that.&lt;/P&gt;&lt;P&gt;The SQL that is supported with the Select By ... tools varies depending on back-end data store.&amp;nbsp; What is the back-end data store, file geodatabase?&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:34:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005892#M34650</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-01T16:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005898#M34651</link>
      <description>&lt;P&gt;You are right about that which I do not clear up. I did not fully clarify my objective.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table of 520,000 census block codes that include broadband download speeds. I have the table sorted by Census Blocks (Ascending) and then by download speeds (Descending) to list the census blocks in the order of highest download speed to lowest (each group of duplicate census blocks are ordered from highest to lowest download speeds).&lt;/P&gt;&lt;P&gt;Because there are duplicates of each census block, I only want to select the census block with the highest download speed. I have the table sorted where the first census block code of each group of duplicates has the highest download speed.&lt;/P&gt;&lt;P&gt;My goal is to select each block code with the highest download speed. The data is stored in a file geodatabase&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;&lt;STRONG&gt;Block Code&amp;nbsp;&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;&lt;STRONG&gt;Download Speed&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234 (row to be selected)&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;25&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234&amp;nbsp;&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;1234&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;5678 (row to be selected)&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;100&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="24px"&gt;5678&lt;/TD&gt;&lt;TD width="50%" height="24px"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 01 Dec 2020 16:50:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005898#M34651</guid>
      <dc:creator>JamieHoffmann</dc:creator>
      <dc:date>2020-12-01T16:50:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005940#M34654</link>
      <description>&lt;P&gt;Definitely test this before relying on it, but in my response above, replace ID by Download Speed in the ORDER BY clause.&lt;BR /&gt;There are other SQL methods, such as TOP(&lt;EM&gt;n&lt;/EM&gt;), subqueries, etc., but been a while since I've used it much and don't want to mislead you.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Dec 2020 18:47:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1005940#M34654</guid>
      <dc:creator>Zeke</dc:creator>
      <dc:date>2020-12-01T18:47:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100290#M45814</link>
      <description>&lt;P&gt;I have a similar issue.&amp;nbsp; I have several records per Incident Device ID and only want the first (numerical order) device per Incident ID.&lt;/P&gt;&lt;P&gt;In the image attached, I have 3 incident device numbers (375444, 375445, and 375449).&amp;nbsp; I want to select the first record of these using the ID field.&amp;nbsp; I have no idea how to structure this query.&amp;nbsp; Any help is greatly appreciated!&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="screen shot.jpg" style="width: 266px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/23459iC65A2AE85A370FD1/image-size/large?v=v2&amp;amp;px=999" role="button" title="screen shot.jpg" alt="screen shot.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 14:26:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100290#M45814</guid>
      <dc:creator>LauraGiboo</dc:creator>
      <dc:date>2021-09-21T14:26:19Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100455#M45835</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/187313"&gt;@LauraGiboo&lt;/a&gt;, as I mention in an earlier comment, the SQL that is supported with the Select By ... tools varies depending on back-end data store. What is the back-end data store, file geodatabase?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 17:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100455#M45835</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-09-21T17:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100476#M45837</link>
      <description>&lt;P&gt;It is an enterprise geodatabase (oracle).&lt;/P&gt;</description>
      <pubDate>Tue, 21 Sep 2021 18:10:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1100476#M45837</guid>
      <dc:creator>LauraGiboo</dc:creator>
      <dc:date>2021-09-21T18:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: SQL: Select first row of duplicates (RESOLVED)</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1101036#M45895</link>
      <description>&lt;P&gt;Since you are using Oracle, the following should or might work:&lt;/P&gt;&lt;LI-CODE lang="sql"&gt;WHERE ID IN (
    SELECT MIN(ID) as ID
    FROM APP_ARCHIVE.RX_INCIDENT_DEVICES_ARCHIVE
    GROUP BY INCIDENT_DEVICE_ID
)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 22 Sep 2021 21:27:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/sql-select-first-row-of-duplicates-resolved/m-p/1101036#M45895</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2021-09-22T21:27:33Z</dc:date>
    </item>
  </channel>
</rss>

