首页 > 代码库 > 时间查询条件区间查询
时间查询条件区间查询
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
时间查询条件区间查询