0

我有一堆 SQL 语句,我想把它们放在一个脚本中并一起运行它们并生成一个 EXCEL (*.xls) 文件;我怎么能在蟾蜍中做到这一点?

脚本示例

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 中将它们组合在一起?

4

1 回答 1

0

您可以尝试“联合所有”,

        select col1 from table1
        union all
        select col1 from table2
        union all
        ...
于 2012-10-26T17:55:55.600 回答