Demo entry 6352944

xxhf

   

Submitted by star on Mar 28, 2017 at 11:04
Language: SQL. Code size: 983 Bytes.

SELECT t5.owner_name,count(distinct T3.PESN_NAME)
  FROM HZDTLINE.TF_BS_ORDERING        T,
       HZDTLINE.TF_BS_ORDERING_DETAIL T1,
       HZDTLINE.TF_PT_ENROLL          T2,
       HZDTLINE.TF_PT_PERSON          T3,
       hzdtline.tf_pt_owner_driving   T4,
       hzdtline.tf_pt_owner           T5
 WHERE T.ORDERS_ID = T1.ORDERS_ID
   AND T2.ENROLL_ID = T.ENROLL_ID
   AND T3.PERSON_ID = T2.PERSON_ID
   AND t4.owner_id = t5.owner_id
   AND T4.OWNER_DRIVING_ID = t2.owner_driving_id
   AND T.ISEFFECT = '0'
   AND T1.ISEFFECT = '0'
   AND T2.ISEFFECT = '0'
   AND T1.CREUSRCODE not like 'CXH%'
   AND T.CREDATE between '2017-03-17' and '2017-03-23'
   /*AND T2.MODE_TYPE IN ('2', '4')*/
   and (t5.dept_code like '36%' or t5.dept_code like '3589%' or t5.dept_code like '4307%' or t5.dept_code like '4306%' or t5.dept_code like '6301%' or t5.dept_code like '3701%')
   and t5.owner_name not like '%慧舟%'
   and T.orders_no is not null
   group by t5.owner_name

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).