我有一堆SQL语句,我想把它们放在一个脚本中,一起运行并生成一个EXCEL (*.xls)文件;我如何在toad中做到这一点?
脚本示例
SELECT SUM(CASE
WHEN dvdn.ACDCALLS = (dvdn.ABNCALLS + dvdn.ABNCALLS1)
THEN dvdn.ABNCALLS
ELSE dvdn.ACDCALLS + dvdn.ABNCALLS - dvdn.ABNCALLS1
END) AS InboundCalls
from ccrdba.CMS_DVDN dvdn , ccrdba.VDN_DIM dim
where DIM.DW_VDN_ID = DVDN.DW_VDN_ID (+)
And DETAIL_GROUP like 'HD%'
and vdn_name not like '%ASM%'
And DIM.AGENT_GROUP <>'Smart Specialist'
And row_date BETWEEN TO_DATE('2012-SEP-01', 'YYYY-MON-DD')AND TO_DATE('2012-SEP-30', 'YYYY-MON-DD')第二条语句
select count(*)
from xx_new.xx_online_registrations@appsread.prd.com oreg
where oreg.client_party_id = 141043767
and oreg.cti_id IS NOT NULL
and oreg.created_by = 'IVR-INTERACTIONS'
and TRUNC(CREATION_DATE) between '01-SEP-2012' and '30-SEP-2012'
and status = 'POSTED'
and last_updated_by = 'IVR-INTERACTIONS'与上面一样,大约有10条SQL语句。如何在ORACLE中将它们组合在一起?
发布于 2012-10-27 01:55:56
你可以试试“全部联合”,
select col1 from table1
union all
select col1 from table2
union all
...https://stackoverflow.com/questions/13091672
复制相似问题