mysql取出两者不一致的数据

来源:互联网 发布:云计算公司排名 编辑:程序博客网 时间:2024/05/17 04:53
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  )

0 0