<?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: Selection Query in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/selection-query/m-p/76895#M4496</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In SQL your GROUP BY and HAVING clauses apply only to the aggregates returned and must be the last statements.&amp;nbsp; You need to first filter out your nulls with a where clause, like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;[Length] In (SELECT [Length] FROM [wMain] WHERE [Material] IS NOT NULL AND [Util_ID] IS NOT NULL GROUP BY [Length] HAVING Count(*)&amp;gt;1 AND )&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 13 Aug 2012 04:36:37 GMT</pubDate>
    <dc:creator>SamHaycraft</dc:creator>
    <dc:date>2012-08-13T04:36:37Z</dc:date>
    <item>
      <title>Selection Query</title>
      <link>https://community.esri.com/t5/data-management-questions/selection-query/m-p/76894#M4495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using this SQL to run a query to find lines that are the same length (THIS WORKS BY ITSELF)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;[Length] In (SELECT [Length] FROM [wMain] GROUP BY [Length] HAVING Count(*)&amp;gt;1 )

&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;What I want to add to it is this&amp;nbsp; (THIS WORKS BY ITSELF)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;[Material] IS NOT NULL AND [Util_ID] IS NOT NULL&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried this but getting an error...ANYONE out there know the correct syntax?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;DO I use a WHERE, if so how?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;[Length] In (SELECT [Length] FROM [wMain] GROUP BY [Length] HAVING Count(*)&amp;gt;1 AND [Material] IS NOT NULL AND [Util_ID] IS NOT NULL)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Dec 2021 22:58:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/selection-query/m-p/76894#M4495</guid>
      <dc:creator>JayKappy</dc:creator>
      <dc:date>2021-12-10T22:58:13Z</dc:date>
    </item>
    <item>
      <title>Re: Selection Query</title>
      <link>https://community.esri.com/t5/data-management-questions/selection-query/m-p/76895#M4496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In SQL your GROUP BY and HAVING clauses apply only to the aggregates returned and must be the last statements.&amp;nbsp; You need to first filter out your nulls with a where clause, like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;[Length] In (SELECT [Length] FROM [wMain] WHERE [Material] IS NOT NULL AND [Util_ID] IS NOT NULL GROUP BY [Length] HAVING Count(*)&amp;gt;1 AND )&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Aug 2012 04:36:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/selection-query/m-p/76895#M4496</guid>
      <dc:creator>SamHaycraft</dc:creator>
      <dc:date>2012-08-13T04:36:37Z</dc:date>
    </item>
  </channel>
</rss>

