select * from basic_crm_channel f where f.CHANNEL_NBR in(
select s.CHANNEL_NBR from (
select CHANNEL_NBR from basic_crm_channel d where d.ORG_ID in(
select store_id from basic_user_store where user_id='MEIRONG')
and d.is_display=0 and d.CHANNEL_CLASS=10 and d.STATUS_CD=1000
) s
left join (
select d.store from patrol_plan d where d.exe_start_time>='2015-07-01' and
d.store in(
select CHANNEL_NBR from basic_crm_channel d where d.ORG_ID in(
select store_id from basic_user_store where user_id='MEIRONG')
and d.is_display=0 and d.CHANNEL_CLASS=10 and d.STATUS_CD=1000)
)x on s.CHANNEL_NBR=x.store where x.store is null )
select s.CHANNEL_NBR from (
select CHANNEL_NBR from basic_crm_channel d where d.ORG_ID in(
select store_id from basic_user_store where user_id='MEIRONG')
and d.is_display=0 and d.CHANNEL_CLASS=10 and d.STATUS_CD=1000
) s
left join (
select d.store from patrol_plan d where d.exe_start_time>='2015-07-01' and
d.store in(
select CHANNEL_NBR from basic_crm_channel d where d.ORG_ID in(
select store_id from basic_user_store where user_id='MEIRONG')
and d.is_display=0 and d.CHANNEL_CLASS=10 and d.STATUS_CD=1000)
)x on s.CHANNEL_NBR=x.store where x.store is null )