像这样的SQL语句该如何优化
表INFO_DETAIL和表MODEL没有可以用于连接的字段
select
nvl((select sum(p.qty) from INFO_DETAIL p where p.proc_no ='TOP' and p.create_date>sysdate-40
and p.board in (SELECT A.Item_Code FROM MODEL a where a.custom='T')),0) as 数量1,
nvl((select sum(p.qty) from INFO_DETAIL p where p.proc_no ='BOT' and p.create_date>sysdate-40
and p.board in (SELECT A.Item_Code FROM MODEL a where a.custom='T')),0) 数量2,
nvl((select sum(p.qty) from INFO_DETAIL p where p.proc_no ='TOP' and p.create_date>sysdate-40
and p.board in (SELECT A.Item_Code FROM MODEL a where a.custom='N')),0) as 数量3,
nvl((select sum(p.qty) from INFO_DETAIL p where p.proc_no ='BOT' and p.create_date>sysdate-40
and p.board in (SELECT A.Item_Code FROM MODEL a where a.custom='N')),0) as 数量4
from dual