<?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>question How to use Group by and Having in a SQL query in NiFi ? in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-Group-by-and-Having-in-a-SQL-query-in-NiFi/m-p/352813#M236600</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to using group by with having clause in the ExecuteSQL processor but it doesn't seem to be returning the count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SQL query looks like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select id_num, count(*) from xyz&amp;nbsp;&lt;/P&gt;&lt;P&gt;where id_num&amp;lt;&amp;gt;0&lt;/P&gt;&lt;P&gt;group by id_num&lt;/P&gt;&lt;P&gt;having count(*)&amp;gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put this in the SQL select query. I just get an empty array. How do I use group by and having in the select query in Nifi? A normal query without these clauses works perfectly but I need a count to check for duplicates in the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in Advance&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 05:54:01 GMT</pubDate>
    <dc:creator>Olivia_4692</dc:creator>
    <dc:date>2022-09-21T05:54:01Z</dc:date>
    <item>
      <title>How to use Group by and Having in a SQL query in NiFi ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-Group-by-and-Having-in-a-SQL-query-in-NiFi/m-p/352813#M236600</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to using group by with having clause in the ExecuteSQL processor but it doesn't seem to be returning the count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SQL query looks like :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select id_num, count(*) from xyz&amp;nbsp;&lt;/P&gt;&lt;P&gt;where id_num&amp;lt;&amp;gt;0&lt;/P&gt;&lt;P&gt;group by id_num&lt;/P&gt;&lt;P&gt;having count(*)&amp;gt;1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I put this in the SQL select query. I just get an empty array. How do I use group by and having in the select query in Nifi? A normal query without these clauses works perfectly but I need a count to check for duplicates in the database.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in Advance&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 05:54:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-Group-by-and-Having-in-a-SQL-query-in-NiFi/m-p/352813#M236600</guid>
      <dc:creator>Olivia_4692</dc:creator>
      <dc:date>2022-09-21T05:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to use Group by and Having in a SQL query in NiFi ?</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-use-Group-by-and-Having-in-a-SQL-query-in-NiFi/m-p/353171#M236653</link>
      <description>&lt;P&gt;I just realised that NiFi only supports "Group by" and doesn't support "HAVING" clause. I had to put the queries in a python script and call an execute stream command processor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 05:20:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-use-Group-by-and-Having-in-a-SQL-query-in-NiFi/m-p/353171#M236653</guid>
      <dc:creator>Olivia_4692</dc:creator>
      <dc:date>2022-09-23T05:20:49Z</dc:date>
    </item>
  </channel>
</rss>

