liyang created KYLIN-2500: ----------------------------- Summary: count(distinct case when condittion) gives incorrect result Key: KYLIN-2500 URL: https://issues.apache.org/jira/browse/KYLIN-2500 Project: Kylin Issue Type: Bug Reporter: liyang
Reported by Roy <aqinnxuk...@163.com>: Use kylin insight submit below sentence, ------------------------------------------select sentence------------------------------------------ select count(distinct memberid) as memberid, count(distinct case when issuccess=1 then memberid else -1 end) as Xmemberid from tables where istest=0 and isvalid=1 and createdate>='2017-03-08' results memberid Xmemberid 863049 863049 ------------------------------------ retrun the same results,if add condittion include where the results is ------------------------------------------------------condittion in where --------------------------------- select count(distinct memberid) as Xmemberid from tables where istest=0 and isvalid=1 and issuccess=1 and createdate>='2017-03-08' results memberid 637290 ---------------------------------- Why appear this problem,anyone has encountered a similar situcation? -- This message was sent by Atlassian JIRA (v6.3.15#6346)