资源回收 left

select DISTINCT human.tid,log_pv_change.systafftid
from human
left join human_user on human.tid=human_user.hid
left join human_house on human.tid = human_house.hid
left join human_tickets on human.tid=human_tickets.hid
left join human_call on human.tid=human_call.hid
left join human_vip on human.tid=human_vip.hid
left join log_pv_change on human_tickets.tid=log_pv_change.data_tid
where human.vuse=1 and human.vdel=1
and (human.tid not in(select human.tid from human_tickets,human WHERE human_tickets.hid=human.tid and human_tickets.expoid='X000000I') )
and human.call_staff_tid = 'X000009V'
and human_tickets.expoid=(select tid from expo where vtop=1)
and human_user.vuse=1 and human_user.vdel=1 and human_user.phone<>''
order by human.stafftid limit 0,2000

posted @ 2014-12-15 09:53  Lion丶褪色的承諾  阅读(106)  评论(0编辑  收藏  举报