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‘;
相关文章
- 01-11洛谷 P2633 Count on a tree 主席树
- 01-11Count on a tree II (树上莫队)
- 01-11「XXI Opencup GP of Tokyo」 Count Min Ratio
- 01-11计算元素个数(count和count_if)
- 01-11BZOJ_1833_[ZJOI2010]count 数字计数_数位DP
- 01-11poj2777--Count Color(线段树,二进制转化)
- 01-11Python 元组 count() 方法
- 01-11[20210218]shared latch spin count 5.txt
- 01-11bzoj2588 Count on a tree
- 01-11Codeforces1355F Guess Divisors Count