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)

  • 相关阅读:
    POJ 3169 Layout(差分约束+链式前向星+SPFA)
    HDU 2680 Choose the best route(SPFA)
    PAT L2-016 愿天下有情人都是失散多年的兄妹(深搜)
    PAT L2-013 红色警报(并查集求连通子图)
    PAT L2-014 列车调度(最长上升nlogn)
    PAT L3-010 是否完全二叉搜索树(二叉搜索树)
    HRBUST 2310 Tree Painting(无向图欧拉路径的性质)
    POJ 2230 Watchcow(有向图欧拉回路)
    UVa 10054 The Necklace(无向图欧拉回路)
    UVa 1600 Patrol Robot(三维广搜)
  • 原文地址:https://www.cnblogs.com/working/p/2918971.html
Copyright © 2011-2022 走看看