--action1 1.297 seconds
select cm.customerid from
zx_dm_customer_manage cm ,
(
select t.customid from
zx_dm_employee_customer t,
(
select t.employeeid from
user_employee t,
(select t.id FROM users t where t.loginid='2101') t_userid_A
where t.userid=t_userid_A.id
) t_employeeid_B where t.employeeid=t_employeeid_B.employeeid
) t_customerid_C
where cm.customerid in t_customerid_C.customid and cm.ifsellnote=1
--action2 0.032 seconds
select cm.customerid from
zx_dm_customer_manage cm
where cm.customerid in
(
select t.customid from
zx_dm_employee_customer t,
(
select t.employeeid from
user_employee t,
(select t.id FROM users t where t.loginid='2101') t_userid_A
where t.userid=t_userid_A.id
) t_employeeid_B where t.employeeid=t_employeeid_B.employeeid
)
and cm.ifsellnote=1
|