• 每日重复推荐报表sql(oracle)


    select *
      from (select rownum RN, B.*
              from (Select Distinct T.REGION_NAME,
                                    T.AREA_NAME,
                                    T.CENTER_NAME,
                                    T.GRID_NAME,
                                    T.POINT_NAME,
                                    T.POINT_ID,
                                    B.product_code,
                                    B.Organise_Id,
                                    B.TO_MOBILE,
                                    RECOMMEND_DATETIME,
                                    reommendRecord,
                                    S.LOGIN_NAME,
                                    P.PRO_START_TIME,
                                    P.PRO_END_TIME
                      From tb_product_info P,
                           Sys_user_info S,
                           tview_organise_super T,
                           (Select T1.FROM_MOBILE,
                                   T1.TO_MOBILE,
                                   T1.Product_Code,
                                   T1.Emp_No,
                                   T1.Organise_Id,
                                   To_Char(T1.Recommend_Datetime, 'YYYY-MM-DD') RECOMMEND_DATETIME,
                                   Count(*) Reommendrecord
                              From Tb_Recommend_Info T1
                             Group By To_Char(T1.Recommend_Datetime, 'YYYY-MM-DD'),
                                      T1.FROM_MOBILE,
                                      T1.TO_MOBILE,
                                      T1.Product_Code,
                                      T1.Organise_Id,
                                      T1.Emp_No) B
                     Where B.Organise_Id = T.POINT_ID
                       And B.Emp_NO = S.EMP_NO
                       And B.Product_Code = P.product_code
                       And Reommendrecord > 1
                       and T.ORGANISE_CODE like 'SCAA%'
                       and 1 = 1
                     Order By RECOMMEND_DATETIME Desc) B)

  • 相关阅读:
    Windows下Git使用记录03 Git GUI与金山快盘组建私人代码仓库进行项目开发
    windows下GIT使用记录00准备阶段
    setnx分布式锁原理
    Redis 中 bgsave 方式持久化的细节问题
    IOS开发(十一):场景(3)模态切换示例
    Android:TextView属性大全
    Android:ActionBar官方指导+个人整理
    IOS开发(十二):UIDatePicker
    IOS开发(十三):UIDatePicker、场景切换综合示例
    IOS开发(十):场景(2)模态切换示例
  • 原文地址:https://www.cnblogs.com/working/p/2918971.html
Copyright © 2020-2023  润新知