clickhouse count

select
discountId,
count() as cnt
from _cw_distributed_db.upsf_ods_upb_tbl_market_activity_log_info_ulsp
where transDt >= ‘2021-07-03 00:00:00‘ AND transDt < ‘2021-07-04 00:00:00‘
group by discountId
order by cnt desc
LIMIT 100

select count(cnt)
from
(
select
discountId,
count() as cnt
from _cw_distributed_db.upsf_ods_upb_tbl_market_activity_log_info_ulsp
where transDt >= ‘2021-07-03 00:00:00‘ AND transDt < ‘2021-07-04 00:00:00‘
group by discountId
order by cnt desc
)
where cnt > 1000


select
count(discountId) as diCount,
countDistinct(cardNo) as cardNoCount,
countDistinct(mobile) as mobileCount,
countDistinct(userId) as userIdCount,
countDistinct(logId) as logIdCount
from _cw_distributed_db.upsf_ods_upb_tbl_market_activity_log_info_ulsp
where transDt >= ‘2021-07-03 00:00:00‘ AND transDt < ‘2021-07-04 00:00:00‘;

clickhouse count

上一篇:[atARC122F]Domination


下一篇:IntelliJ IDEA 2021.3 最新激活方法 永久激活 IDE激活网