kylin-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ge Silas <go...@live.cn>
Subject Re: count if/case when SQL
Date Mon, 04 Dec 2017 13:11:21 GMT
Hi,

This could be an issue… Does below serve what you want?

select sum(case when A=‘a1’ then 1 else 0 end)

Thanks,
Silas

On 4 Dec 2017, at 3:21 PM, skyyws <skyyws@163.com<mailto:skyyws@163.com>> wrote:

Hello all,
I found that kylin not support count if/cast when sql which mysql supported, like this:

select count(if(A='a1',true,null)) as a1, count(if(A='a2',true,null)) as a2 from table

select count(case when A='a1' then true else null end) a1,  count(case when A='a2' then true
else null end) a2 from table

Some of our users use "union" replace this function which lead to a very long sql. So I want
to ask, if kylin will support this sql in the near future?


2017-12-04
________________________________
skyyws

Mime
View raw message