zoukankan      html  css  js  c++  java
  • ads_uv_count

    sql:

    insert into table ads_uv_count
    select 
        '2020-03-12' dt,
        daycount.ct,
        wkcount.ct,
        mtcount.ct,
        if(date_add(next_day('2020-03-12','MO'),-1)='2020-03-12','Y','N'),
        if(last_day('2020-03-12')='2020-03-12','Y','N')
    from 
    (
        select 
            '2020-03-12' dt,
            count(*) ct
        from dwt_uv_topic
        where login_date_last='2020-03-12'
    ) daycount
    join 
    (
        select
            '2020-03-12' dt,
            count(*) ct
        from dwt_uv_topic
        where login_date_last>=date_add(next_day('2020-03-12','MO'),-7)
        and login_date_last<=date_add(next_day('2020-03-12','MO'),-1)
    ) wkcount
    on daycount.dt=wkcount.dt
    join 
    (
        select
            '2020-03-12' dt,
            count(*) ct
        from dwt_uv_topic
        where date_format(login_date_last,'yy-MM')=date_format('2020-03-12','yy-MM')
    ) mtcount
    on mtcount.dt=daycount.dt;
  • 相关阅读:
    代码1
    js中级第13天
    dom 浏览器模型
    js中级第12天
    js中级第11天
    js中级第十天
    js中级第九天
    js中级第8天
    js中级第六天
    js中级第七天
  • 原文地址:https://www.cnblogs.com/ldy233/p/14437360.html
Copyright © 2011-2022 走看看