zoukankan      html  css  js  c++  java
  • 每日重复推荐报表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)

  • 相关阅读:
    CentOS Linux下VNC Server远程桌面配置详解
    Java 中的悲观锁和乐观锁的实现
    spring @configuration使用
    MySQL 汉字拼音
    chmod用数字来表示权限的方法
    C语言创建删不掉的目录
    Android小经验
    系统清理——查找大文件
    最全Pycharm教程(42)——Pycharm扩展功能之Emacs外部编辑器
    怎样学习程序
  • 原文地址:https://www.cnblogs.com/working/p/2918971.html
Copyright © 2011-2022 走看看