<?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 Re: Strage behaviour of alias for aggreage function query field in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1885#M314</link>
    <description>&lt;P&gt;Why? &amp;nbsp;Because COUNT(*) is an aggregate and to filter on a aggregate you would use a HAVING clause, or use an in-line view as you have done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 30 Sep 2013 04:24:44 GMT</pubDate>
    <dc:creator>grahn</dc:creator>
    <dc:date>2013-09-30T04:24:44Z</dc:date>
    <item>
      <title>Strage behaviour of alias for aggreage function query field</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1881#M313</link>
      <description>&lt;P&gt;Starting Impala Shell in unsecure mode&lt;BR /&gt;Connected to node05.kyc.megafon.ru:21000&lt;BR /&gt;Server version: impalad version 1.1.1 RELEASE (build 83d5868f005966883a918a819a449f636a5b3d5f)&lt;BR /&gt;Welcome to the Impala shell. Press TAB twice to see a list of available commands.&lt;BR /&gt;&lt;BR /&gt;Copyright (c) 2012 Cloudera, Inc. All rights reserved.&lt;BR /&gt;&lt;BR /&gt;(Shell build version: Impala Shell v1.1.1 (83d5868) built on Fri Aug 23 17:28:05 PDT 2013)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It works:&lt;/P&gt;&lt;P&gt;select cnt, msisdn from(&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; select count(*) as cnt, msisdn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; from ZZZ_ROUTES_MSK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; group by msisdn&lt;BR /&gt;) t&lt;BR /&gt;where cnt &amp;gt; 50 and cnt &amp;lt; 100&lt;BR /&gt;order by cnt desc limit 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It doesn't work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;select count(*) as cnt, msisdn&lt;BR /&gt;from ZZZ_ROUTES_MSK&lt;/P&gt;&lt;P&gt;where cnt &amp;gt; 50 and cnt &amp;lt; 100&lt;/P&gt;&lt;P&gt;group by msisdn&lt;BR /&gt;order by cnt desc limit 10;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Query: select count(*) as cnt, msisdn&lt;BR /&gt;from ZZZ_ROUTES_MSK&lt;BR /&gt;group by msisdn&lt;BR /&gt;where cnt &amp;gt; 50 and cnt &amp;lt; 100&lt;BR /&gt;order by cnt desc limit 10&lt;BR /&gt;&lt;BR /&gt;[localhost:21000] &amp;gt; select count(*) as cnt, msisdn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt; from ZZZ_ROUTES_MSK&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt; where cnt &amp;gt; 50 and cnt &amp;lt; 100&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt; group by msisdn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;gt; order by cnt desc limit 10;&lt;BR /&gt;Query: select count(*) as cnt, msisdn&lt;BR /&gt;from ZZZ_ROUTES_MSK&lt;BR /&gt;where cnt &amp;gt; 50 and cnt &amp;lt; 100&lt;BR /&gt;group by msisdn&lt;BR /&gt;order by cnt desc limit 10&lt;BR /&gt;&lt;STRONG&gt;ERROR: AnalysisException: couldn't resolve column reference: 'cnt'&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 08:48:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1881#M313</guid>
      <dc:creator>sergey.sheypak566881637</dc:creator>
      <dc:date>2022-09-16T08:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: Strage behaviour of alias for aggreage function query field</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1885#M314</link>
      <description>&lt;P&gt;Why? &amp;nbsp;Because COUNT(*) is an aggregate and to filter on a aggregate you would use a HAVING clause, or use an in-line view as you have done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Sep 2013 04:24:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1885#M314</guid>
      <dc:creator>grahn</dc:creator>
      <dc:date>2013-09-30T04:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Strage behaviour of alias for aggreage function query field</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1887#M315</link>
      <description>&lt;P&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Oct 2013 07:57:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Strage-behaviour-of-alias-for-aggreage-function-query-field/m-p/1887#M315</guid>
      <dc:creator>sergey.sheypak566881637</dc:creator>
      <dc:date>2013-10-07T07:57:05Z</dc:date>
    </item>
  </channel>
</rss>

