Home | About | Sematext search-lucene.com search-hadoop.com
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB
 Search Hadoop and all its subprojects:

Switch to Threaded View
Hive >> mail # user >> Multi Table Join & count Distinct


Copy link to this message
-
Re: Multi Table Join & count Distinct
try removing C1,C2 and C3 from select

count should give you exactly one output, where as c1,c2,c3 may vary as per
table

On Tue, May 22, 2012 at 5:02 AM, cmdr taco <[EMAIL PROTECTED]> wrote:

> When I try to run below query, but for some reason I'm
> getting weird results  for the  C2_CNT, its not giving distinct value count
>
>
> SELECT
>  C1,C2,C3
> ,COUNT(DISTINCT B.C2) C2_CNT
> ,COUNT(C.C2) CC_CNT
> FROM
> TABLE_A A
> JOIN TABLE_B B on (A.C1=B.C1  )
> left outer join  TABLE_C C on (B.C2 = C.C2  )
> group by C1,C2,C3
>
>
>
>
--
Nitin Pawar
NEW: Monitor These Apps!
elasticsearch, apache solr, apache hbase, hadoop, redis, casssandra, amazon cloudwatch, mysql, memcached, apache kafka, apache zookeeper, apache storm, ubuntu, centOS, red hat, debian, puppet labs, java, senseiDB