--查询EF_AR_HEADER 中满足对应的明细信息中的字段 ap_detail_no null 和not null都存在的记录 select a.ar_no from EF_AR_HEADER a where a.create_time > to_date('2017-02-01','yyyy-mm-dd') and exists ( select 1 from ef_ar_detail b where b.ar_no = a.ar_no and ( select avg(nvl2(c.ap_detail_no,'1','0')) from ef_ar_detail c where c.ar_no = b.ar_no ) >0 and ( select avg(nvl2(c.ap_detail_no,'0')) from ef_ar_detail c where c.ar_no = b.ar_no ) <1 );
第一篇文章记录
原文链接:https://www.f2er.com/oracle/210235.html