我对SQL还是很陌生,希望能对您有所帮助。
我从同事那里继承了一些脚本。谁不再在附近问。
我收到ORA-00933命令未正确结束
错误在行:13列:96
请参阅下面的错误图片
我的代码如下。一如既往,我们将不胜感激。
码
(select coalesce ("DTOVS".MDM_DMN_GEO_CD,"ITOVS".MDM_DMN_GEO_CD)as "MDM_DMN_GEO_CD"
,coalesce("DTOVS".info_src_cd,"ITOVS".info_src_cd) as "INFO_SRC_CD"
,coalesce("DTOVS"."Total DToVs"+"ITOVS"."Total IToVs","DTOVS"."Total DToVs","ITOVS"."Total IToVs",0) as "TOTAL TOVS" from
(select count(distinct src_party_id) as "Total DToVs", MDM_DMN_GEO_CD,Info_src_cd from efpia.cust_expns
where HDD_STATUS_CD='N' and expns_dt<TO_DATE('01/01/2016','dd/mm/yyyy') group by MDM_DMN_GEO_CD,Info_Src_Cd) "DTOVS"
full outer join
(select count(distinct src_party_id) as "Total IToVs", MTNG_BDGT_EXPNS.MDM_DMN_GEO_CD,MTNG_BDGT_EXPNS.Info_src_cd
from efpia.MTNG_BDGT_EXPNS
inner join EFPIA.MTNG on (MTNG_BDGT_EXPNS.SRC_MTNG_ID=MTNG.SRC_MTNG_ID and MTNG_BDGT_EXPNS.MDM_DMN_GEO_CD=MTNG.MDM_DMN_GEO_CD
and MTNG_BDGT_EXPNS.INFO_SRC_CD=MTNG.INFO_SRC_CD)
where MTNG_BDGT_EXPNS.HDD_STATUS_CD = 'N' and MTNG_STRT_DT < TO_DATE('01/01/2016','dd/mm/yyyy')
group by MTNG_BDGT_EXPNS.MDM_DMN_GEO_CD,MTNG_BDGT_EXPNS.Info_Src_Cd) "ITOVS"
on ("DTOVS".MDM_DMN_GEO_CD="ITOVS".MDM_DMN_GEO_CD and "DTOVS".Info_src_cd="ITOVS".info_src_cd)) "TOTAL"
我认为错误发生在这条线上
on ("DTOVS".MDM_DMN_GEO_CD="ITOVS".MDM_DMN_GEO_CD and "DTOVS".Info_src_cd="ITOVS".info_src_cd)) "TOTAL"
但我不能确定:-)
最佳答案
这是代码的一部分吗?因为如果不是这样,则不需要第一个(
并从脚本末尾删除-) "TOTAL""