码迷,mamicode.com
首页 > 其他好文 > 详细

时间查询条件区间查询

时间:2017-06-06 18:34:42      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:区间查询   rom   custom   order   customer   时间   date   ati   object   

SELECT COUNT(1)
  FROM (SELECT w.log_name,
               w.cust_party_id,
               w.creation_date,
               row_number() over(PARTITION BY w.cust_party_id ORDER BY w.creation_date DESC) rn
          FROM cop_work_log w
         WHERE w.project_no IS NULL
           AND w.or_line_id IS NULL) cwl,
       cop_customer_header_v h,
       cop_fae_customer_assign ass,
       cop_cop_my_attention atten
 WHERE 1 = 1
   AND cwl.rn(+) = 1
   AND cwl.cust_party_id(+) = h.cust_party_id
   AND h.cust_party_id = ass.cust_party_id(+)
   AND(cwl.creation_date >= to_date(l_date_f, ‘YYYY-MM-DD‘) or l_date_f is null)
   AND(cwl.creation_date <= to_date(l_date_t, ‘YYYY-MM-DD‘) or l_date_t is null)
   AND ass.assign_person_id = 4012
   AND h.cust_party_id = atten.object_id(+)
   AND atten.attend_type(+) = 0

时间查询条件区间查询

标签:区间查询   rom   custom   order   customer   时间   date   ati   object   

原文地址:http://www.cnblogs.com/albert-think/p/6952458.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!