-- 医院与微信差异 select JZDH00,JYLSH0,JFJE00 from ( select to_number('0') jzdh00,JYLSH0,JFJE00 from VW_SF_BRJFB0_WX A where JFRQ00='20150812' and JFRQ00||JFSJ00>='2015081200:00:00' and ghh000='600049979878' and JFRQ00||JFSJ00<='2015081223:59:59' and a.jylsh0 is not null minus select to_number('0') jzdh00,JYLSH0,ZJE000 from VW_SF_YDZFDZ_WX A where CZRQ00='20150812' and CZRQ00||CZSJ00>='2015081200:00:00' and ghh000='600049979878' and CZRQ00||CZSJ00<='2015081223:59:59' union all select jzdh00,JYLSH0,JFJE00 from VW_SF_BRJFB0_WX A where JFRQ00='20150812' and JFRQ00||JFSJ00>='2015081200:00:00' and JFRQ00||JFSJ00<='2015081223:59:59' and a.jylsh0 is null) order by jzdh00 ---- 微信与医院差异 select jzdh00, JYLSH0,ZJE000 JFJE00 from ( select to_number('0') jzdh00,JYLSH0,ZJE000 from VW_SF_YDZFDZ_WX A where CZRQ00='20150812' and CZRQ00||CZSJ00>='2015081200:00:00' and CZRQ00||CZSJ00<='2015081223:59:59' minus select to_number('0') jzdh00,JYLSH0,JFJE00 from VW_SF_BRJFB0_WX A where JFRQ00='20150812' and JFRQ00||JFSJ00>='2015081200:00:00' and JFRQ00||JFSJ00<='2015081223:59:59' )