<?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: how to use MAX function in Definition Query/ArcMap? in Geodatabase Questions</title>
    <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843648#M4845</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax would be&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;ID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MAX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;table&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a note of caution, using subqueries in definition queries isn't ideal.&amp;nbsp; Depending on the complexity of the data set and the subquery itself, there can be performance or portability issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 09 Nov 2018 21:55:52 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2018-11-09T21:55:52Z</dc:date>
    <item>
      <title>how to use MAX function in Definition Query/ArcMap?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843647#M4844</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How I can select a record in a column with Largest/MAX value in&amp;nbsp;"Definition Query" in ArcMap?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for example, i have a feature with 10 records&amp;nbsp;&lt;/P&gt;&lt;P&gt;in the ID column; the records are 1, 2, 3,4,5,6,7,8,9,10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;in the&amp;nbsp;&lt;SPAN&gt;"Definition Query", i would like to select on the largest ID record&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;i have tried all kinds of MAX sql but they didn't&amp;nbsp;work, any ideas?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ID &amp;gt;= MAX(ID)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"ID" &amp;gt;= MAX("ID") ....etc&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;WL&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2018 20:49:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843647#M4844</guid>
      <dc:creator>WilsonLee</dc:creator>
      <dc:date>2018-11-09T20:49:33Z</dc:date>
    </item>
    <item>
      <title>Re: how to use MAX function in Definition Query/ArcMap?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843648#M4845</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The syntax would be&lt;/P&gt;&lt;PRE class="line-numbers language-sql"&gt;&lt;CODE&gt;ID &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;SELECT&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;MAX&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ID&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;FROM&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;table&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just a note of caution, using subqueries in definition queries isn't ideal.&amp;nbsp; Depending on the complexity of the data set and the subquery itself, there can be performance or portability issues.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2018 21:55:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843648#M4845</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-11-09T21:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: how to use MAX function in Definition Query/ArcMap?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843649#M4846</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image" height="308" src="https://community.esri.com/legacyfs/online/429290_definition_query.png" width="626" /&gt;&lt;/P&gt;&lt;P&gt;This query selects the record with the maximum value... the 'select&amp;nbsp; … from … ' syntax&lt;/P&gt;&lt;P&gt;buried a bit in ...&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm" title="http://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 09 Nov 2018 21:59:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843649#M4846</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-11-09T21:59:25Z</dc:date>
    </item>
    <item>
      <title>Re: how to use MAX function in Definition Query/ArcMap?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843650#M4847</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am have a problem with the syntax&amp;nbsp; Hopefully someone can assist.&amp;nbsp; When i type in the sql expression Pro 2.5 finds an error but i can't seem to find what the errors is.&amp;nbsp; I even copied the script directly from the blog and only changed out the fields and table, but still no luck&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm" title="https://pro.arcgis.com/en/pro-app/help/mapping/navigation/sql-reference-for-elements-used-in-query-expressions.htm"&gt;SQL reference for query expressions used in ArcGIS—ArcGIS Pro | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;GDP2006 &amp;gt; (SELECT MAX(GDP2005) FROM countries)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Not sure if or why but the query is on a stand alone table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/500950_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 20:03:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843650#M4847</guid>
      <dc:creator>HeathAnderson</dc:creator>
      <dc:date>2020-07-21T20:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: how to use MAX function in Definition Query/ArcMap?</title>
      <link>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843651#M4848</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Check the database / schema , and permissions to table / layer&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(SELECT MAX(GDP2005) FROM gisdata.dbo.countries)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Craig Swadner (GIS Coordinator)&lt;/P&gt;&lt;P&gt;City of Cape Coral&lt;/P&gt;&lt;P&gt;1015 Cultural Park Blvd.&lt;/P&gt;&lt;P&gt;Cape Coral, Fl 33990&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did you know the best way to report issues to ITS is to use the Service Desk system?  This will ensure someone in ITS gets your request and allows us to track the progress.  Please enter all your issues and/or questions by clicking https://breeze.cape.capecoral.net&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jul 2020 20:14:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/geodatabase-questions/how-to-use-max-function-in-definition-query-arcmap/m-p/843651#M4848</guid>
      <dc:creator>CraigSwadner</dc:creator>
      <dc:date>2020-07-21T20:14:51Z</dc:date>
    </item>
  </channel>
</rss>

