zoukankan      html  css  js  c++  java
  • 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';

  • 相关阅读:
    servicestack and redis
    图片服务器
    CRQS介绍
    javascript闭包之购物车加减及提示
    javascript best practices
    EOF
    2012年回顾
    volatile
    通过inode来操作文件
    采样问题
  • 原文地址:https://www.cnblogs.com/tonggc1668/p/14987038.html
Copyright © 2011-2022 走看看