<?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: TOP 100 in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570260#M949</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Lance are there any plans to support TOP functionality or any of the SELECT modifiers (ie DISTINCT)? I think its odd that there isn't a way to access full SQL query abilities.&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Sep 2013 21:29:30 GMT</pubDate>
    <dc:creator>TomHoober</dc:creator>
    <dc:date>2013-09-04T21:29:30Z</dc:date>
    <item>
      <title>TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570256#M945</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is there any SQL that is valid with the FGDB that will help me limit the results returned?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have tried TOP, LIMIT etc..&amp;nbsp; but none work.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I could do it all in&amp;nbsp; code, but I would rather retrieve only the records i need from the table.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am using the .NET wrapper.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2012 13:06:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570256#M945</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2012-10-14T13:06:54Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570257#M946</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Andrew,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The help states the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;SELECT * FROM forms the first part of the SQL expression and is automatically supplied for you. Because you are selecting columns as a whole, you cannot restrict the SELECT to return only some of the columns in the corresponding table; thus, the hard-coded SELECT * syntax. For this reason, keywords like DISTINCT, ORDER BY, GROUP BY, and so on, cannot be used readily in a SQL query except when using subqueries. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So what you could try and do (I must warn I have not tried this) is create a sub query that performs the limit then use the IN command to select out the records that you need, I.e:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;objectID IN (select objectID from (select objectID, column from 'table' where 'expression' order by 'column' limit 100))&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I say don't know if this will work but you never know&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anthony&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 14 Oct 2012 16:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570257#M946</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2012-10-14T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570258#M947</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for the reply Anthony.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am able to get a full SQL query against the table using the below code..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;C#&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
string sql = "SELECT * FROM " + tableName
RowCollection rows = geodatabase.ExecuteSQL(sql);
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;From my knowledge the ExecuteSQL function will take raw valid SQL outlined in the doc's but the doc's do not show any way to limit the returned result (i.e LIMIT or TOP). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Drew&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 00:32:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570258#M947</guid>
      <dc:creator>Drew</dc:creator>
      <dc:date>2021-12-12T00:32:52Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570259#M948</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;TOP, LIMIT is not currently supported.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 15 Oct 2012 14:53:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570259#M948</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2012-10-15T14:53:42Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570260#M949</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Lance are there any plans to support TOP functionality or any of the SELECT modifiers (ie DISTINCT)? I think its odd that there isn't a way to access full SQL query abilities.&amp;nbsp; Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Sep 2013 21:29:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570260#M949</guid>
      <dc:creator>TomHoober</dc:creator>
      <dc:date>2013-09-04T21:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: TOP 100</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570261#M950</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I believe you will find that SELECT DISTINCT has worked all along.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are no immediate plans to implement SELECT TOP.&amp;nbsp; I am not convinced that it is particularly useful.&amp;nbsp; If you want the equivalent of SELECT TOP 100 * from xxx, why not just keep track of how many rows you have read in and then stop after you hit 100?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Sep 2013 14:46:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/top-100/m-p/570261#M950</guid>
      <dc:creator>DavidSousa</dc:creator>
      <dc:date>2013-09-11T14:46:22Z</dc:date>
    </item>
  </channel>
</rss>

