Hi,
Support for multiple conditions query kylin?Just like this:
All of the fields that have been set the dimension
eg1:
select 
sum(a.Reqnum),sum(a.shownum),sum(a.clicknum),sum(a.RtbActBidReq),sum(a.RtbWinBidReq)
 
from
(
select
case when RequestMode=1 and ProcessNode>=2 then 1 else 0 end as Reqnum,
case when RequestMode=2 and IsEffective='1' then 1 else 0 end as shownum,
case when RequestMode=3 and IsEffective='1' then 1 else 0 end as clicknum,
case when ADPlatformProviderID>=100000 and IsEffective='1' and IsBilling='1' 
and IsBid=1 then 1 else 0 end as RtbActBidReq,
case when ADPlatformProviderID>=100000 and IsEffective='1' and IsBilling='1' 
and IsWin=1 then 1 else 0 end as RtbWinBidReq
from parquetlog
) a 

eg2:
select sum(if(RequestMode=1 and ProcessNode>=1,1,0)) from parquetlog


Thinks!!

Reply via email to