select to_char(t.currmonthcount / 10000, 'fm9999990.9990'),
to_char(t.currmonthmoney / 10000, 'fm9999990.90'),
to_char(t.premonthcount / 10000, 'fm9999990.9990'),
to_char(t.premonthmoney / 10000, 'fm9999990.90'),
to_char(t.curryearcount / 10000, 'fm9999990.9990'),
to_char(t.curryearmoney / 10000, 'fm9999990.90'),
to_char(t.preyearcount0 / 10000, 'fm9999990.9990'),
to_char(t.preyearmoney0 / 10000, 'fm9999990.90'),
to_char(t.preyearcount / 10000, 'fm9999990.9990'),
to_char(t.preyearmoney / 10000, 'fm9999990.90')
from (select '00' as salechnl,'00' as risktype,
(select sumzccontanaly('201706', a.managecom, '', '0', '4') from dual) currmonthcount,
(select sumzccontanaly('201706', a.managecom, '', '0', '5') from dual) currmonthmoney,
(select sumzccontanaly('201705', a.managecom, '', '0', '4') from dual) premonthcount,
(select sumzccontanaly('201705', a.managecom, '', '0', '5') from dual) premonthmoney,
(select sumzccontanaly('201706', a.managecom, '', '1', '4') from dual) curryearcount,
(select sumzccontanaly('201706', a.managecom, '', '1', '5') from dual) curryearmoney,
(select sumzccontanaly('201606', a.managecom, '', '0', '4') from dual) preyearcount0,
(select sumzccontanaly('201606', a.managecom, '', '0', '5') from dual) preyearmoney0,
(select sumzccontanaly('201606', a.managecom, '', '1', '4') from dual) preyearcount,
(select sumzccontanaly('201606', a.managecom, '', '1', '5') from dual) preyearmoney
from (select '8605' managecom from dual) a
union all
select a.salechnl salechnl, a.salechnl risktype,
(select ZccontAnaly('201706', a.managecom,a.salechnl, '', '0', '2') from dual) currmonthcount,
(select ZccontAnaly('201706', a.managecom, a.salechnl, '', '0', '3') from dual) currmonthmoney,
(select ZccontAnaly('201705', a.managecom, a.salechnl,'','0', '2')from dual) premonthcount,
(select ZccontAnaly('201705', a.managecom, a.salechnl, '', '0', '3')from dual) premonthmoney,
(select ZccontAnaly('201706', a.managecom,a.salechnl,'','1','2')from dual) curryearcount,
(select ZccontAnaly('201706', a.managecom,a.salechnl, '', '1','3') from dual) curryearmoney,
(select ZccontAnaly('201606',a.managecom,a.salechnl, '', '0','2') from dual) preyearcount0,
(select ZccontAnaly('201606',a.managecom, a.salechnl, '', '0', '3') from dual) preyearmoney0,
(select ZccontAnaly('201606', a.managecom, a.salechnl, '', '1', '2')from dual) preyearcount,
(select ZccontAnaly('201606', a.managecom,a.salechnl, '', '1', '3') from dual) preyearmoney
from (select code salechnl, '8605' managecom from ldcode1 where codetype = 'riskcodegroup' and code in ('01', '07')) a
union all
select a.salechnl salechnl,a.risktype risktype,
(select ZccontAnaly('201706', a.managecom,a.salechnl, a.risktype,'0','0') from dual) currmonthcount,
(select ZccontAnaly('201706', a.managecom,a.salechnl, a.risktype, '0', '1') from dual) currmonthmoney,
(select ZccontAnaly('201705', a.managecom, a.salechnl, a.risktype, '0', '0')from dual) premonthcount,
(select ZccontAnaly('201705',a.managecom,a.salechnl,a.risktype, '0','1')from dual) premonthmoney,
(select ZccontAnaly('201706',a.managecom,a.salechnl,a.risktype,'1','0')from dual) curryearcount,
(select ZccontAnaly('201706',a.managecom,a.salechnl,a.risktype, '1','1')from dual) curryearmoney,
(select ZccontAnaly('201606',a.managecom,a.salechnl,a.risktype,'0','0')from dual) preyearcount0,
(select ZccontAnaly('201606',a.managecom,a.salechnl,a.risktype,'0','1')from dual) preyearmoney0,
(select ZccontAnaly('201606',a.managecom,a.salechnl,a.risktype,'1','0')from dual) preyearcount,
(select ZccontAnaly('201606',a.managecom,a.salechnl,a.risktype,'1','1')from dual) preyearmoney
from (select code salechnl,code1 risktype,codename codename,'8605' managecom from ldcode1 where codetype = 'riskcodegroup'
and code in ('02', '03')) a
union all
select a.salechnl salechnl,a.risktype risktype,
(select sumzccontanaly('201706',a.managecom,a.salechnl,'0','0')from dual) currmonthcount,
(select sumzccontanaly('201706',a.managecom,a.salechnl, '0', '1')from dual) currmonthmoney,
(select sumzccontanaly('201705',a.managecom,a.salechnl,'0','0')from dual) premonthcount,
(select sumzccontanaly('201705',a.managecom, a.salechnl, '0', '1')from dual) premonthmoney,
(select sumzccontanaly('201706',a.managecom,a.salechnl,'1','0')from dual) curryearcount,
(select sumzccontanaly('201706',a.managecom,a.salechnl,'1','1')from dual) curryearmoney,
(select sumzccontanaly('201606',a.managecom,a.salechnl,'0','0')from dual) preyearcount0,
(select sumzccontanaly('201606',a.managecom,a.salechnl,'0','1') from dual) preyearmoney0,
(select sumzccontanaly('201606',a.managecom, a.salechnl, '1','0')from dual) preyearcount,
(select sumzccontanaly('201606', a.managecom,a.salechnl,'1','1')from dual) preyearmoney
from (select salechnl salechnl,'00' risktype,'' codename,'8605' managecom from (select '02' salechnl from dual
union all
select '03' salechnl from dual)) a) t
order by t.salechnl, t.risktype
SQL性能优化,对这方面不太懂。。求教大神
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
3条回答 默认 最新
悬赏问题
- ¥20 删除和修改功能无法调用
- ¥15 kafka topic 所有分副本数修改
- ¥15 小程序中fit格式等运动数据文件怎样实现可视化?(包含心率信息))
- ¥15 如何利用mmdetection3d中的get_flops.py文件计算fcos3d方法的flops?
- ¥40 串口调试助手打开串口后,keil5的代码就停止了
- ¥15 电脑最近经常蓝屏,求大家看看哪的问题
- ¥60 高价有偿求java辅导。工程量较大,价格你定,联系确定辅导后将采纳你的答案。希望能给出完整详细代码,并能解释回答我关于代码的疑问疑问,代码要求如下,联系我会发文档
- ¥50 C++五子棋AI程序编写
- ¥30 求安卓设备利用一个typeC接口,同时实现向pc一边投屏一边上传数据的解决方案。
- ¥15 SQL Server analysis services 服务安装失败