<?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: FGDB Select By Attributes — Subquery SELECT clause doesn't allow expressions in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/fgdb-select-by-attributes-subquery-select-clause/m-p/1375392#M8839</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03533443 - FGDB Select By Attributes — Subquery SELECT clause doesn't allow expressions&lt;/P&gt;&lt;P&gt;"Esri Inc has informed me that this behavior you're seeing is expected behavior. The nature of how subqueries work and the very limited nature of its implementation in FGDBs means that only those comparison operators and set functions outlined in the documentation are supported.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-F5320DB5-4E54-4D49-BF31-A58F5379ED9F" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-F5320DB5-4E54-4D49-BF31-A58F5379ED9F&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This explains why arithmetic operators, cast functions, string concatenation, and the like, fail validation in File Geodatabases. Using enterprise or mobile geodatabases is the suggested workaround."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 29 Jan 2024 17:23:52 GMT</pubDate>
    <dc:creator>Bud</dc:creator>
    <dc:date>2024-01-29T17:23:52Z</dc:date>
    <item>
      <title>FGDB Select By Attributes — Subquery SELECT clause doesn't allow expressions</title>
      <link>https://community.esri.com/t5/geodatabase-questions/fgdb-select-by-attributes-subquery-select-clause/m-p/1372669#M8815</link>
      <description>&lt;P&gt;&lt;EM&gt;ArcGIS Pro 3.2.1; file geodatabase&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In Select by Attributes, this works:&lt;/P&gt;&lt;PRE&gt; objectid in (
    select
        &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;objectid&lt;/STRONG&gt;&lt;/FONT&gt;
    from
        species_records)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_0-1705739433979.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92321i68BD8065045175D6/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_0-1705739433979.png" alt="Bud_0-1705739433979.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this doesn't work:&lt;/P&gt;&lt;PRE&gt;objectid in (
    select
        objectid&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;+0&lt;/STRONG&gt;&lt;/FONT&gt;
    from
        species_records)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bud_1-1705739534269.png" style="width: 999px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/92322iEB424537C4FA1194/image-size/large?v=v2&amp;amp;px=999" role="button" title="Bud_1-1705739534269.png" alt="Bud_1-1705739534269.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;ERROR 000358: Invalid expression&lt;/PRE&gt;&lt;P&gt;Likewise, any other SQL expression throws the same error, including expressions on text or date fields.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why does a SQL expression in the SELECT clause of a subquery throw an error in Select By Attributes?&lt;/P&gt;&lt;P&gt;I don't have that problem in mobile or enterprise geodatabases, only file geodatabases.&lt;/P&gt;&lt;P&gt;My example in this post is oversimplified for the purpose of demonstrating the issue. My real use case is to use Select By Attributes to select the &lt;A href="https://community.esri.com/t5/geodatabase-questions/select-maximum-values-in-select-by-attributes/m-p/1370328/highlight/true#M8783" target="_self"&gt;greatest 1 per group&lt;/A&gt; (ties or no ties).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Related idea: &lt;A href="https://community.esri.com/t5/arcgis-pro-ideas/fgdb-select-by-attributes-expressions-in-subquery/idi-p/1375754" target="_self"&gt;FGDB Select By Attributes — Expressions in subquery SELECT clause&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jan 2024 20:39:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/fgdb-select-by-attributes-subquery-select-clause/m-p/1372669#M8815</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-30T20:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: FGDB Select By Attributes — Subquery SELECT clause doesn't allow expressions</title>
      <link>https://community.esri.com/t5/geodatabase-questions/fgdb-select-by-attributes-subquery-select-clause/m-p/1375392#M8839</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;P&gt;Esri Case #03533443 - FGDB Select By Attributes — Subquery SELECT clause doesn't allow expressions&lt;/P&gt;&lt;P&gt;"Esri Inc has informed me that this behavior you're seeing is expected behavior. The nature of how subqueries work and the very limited nature of its implementation in FGDBs means that only those comparison operators and set functions outlined in the documentation are supported.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-F5320DB5-4E54-4D49-BF31-A58F5379ED9F" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm#GUID-F5320DB5-4E54-4D49-BF31-A58F5379ED9F&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This explains why arithmetic operators, cast functions, string concatenation, and the like, fail validation in File Geodatabases. Using enterprise or mobile geodatabases is the suggested workaround."&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jan 2024 17:23:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/fgdb-select-by-attributes-subquery-select-clause/m-p/1375392#M8839</guid>
      <dc:creator>Bud</dc:creator>
      <dc:date>2024-01-29T17:23:52Z</dc:date>
    </item>
  </channel>
</rss>

