今天后台在执行SQL查询时报如下错误:
execerror=ORA-00918: column ambiguously defined when generage sheet data:
insert into D_SHEET_DATA (REPORT_ID,SHEET_NO,RATE_DATE,ROW_NO,COLNO1,COLNO2,COLNO3,COLNO4,COLNO5,COLNO6,COLNO7,COLNO8,COLNO9,COLNO10,COLNO11,COLNO12) select 'CTOG_04',1,'201310',rownum,a.* from (with AI as(
select cust_code as cust_code,cust_name as cust_name,sum(account_fee) as account_fee,sum(settle_fee) as settle_fee from
(select b.cust_code as cust_code,b.cust_name as cust_name,sum(account_fee) as account_fee,sum(a.settle_fee) as settle_fee
from D_IIXL_SHARE_RESULT_201310 a,STT_OBJECT b
where a.settle_carrier_id=b.cust_id
group by cust_code,cust_name
)
group by cust_code,cust_name
),
DI as
(select b.cust_code as cust_code,b.cust_name as cust_name,sum(account_fee) as account_fee,sum(a.settle_fee) as settle_fee
from D_IIXL_SHARE_RESULT_201310 a,STT_OBJECT b
where a.settle_carrier_id=7463 and a.settle_carrier_id=b.cust_id
group by cust_code,b.cust_name
)
select AI.cust_code,AI.cust_name,nvl(AI.account_fee,0),nvl(AI.settle_fee,0),
0,0,0,0,nvl(DI.account_fee,0),nvl(DI.settle_fee,0),
nvl(DI.account_fee,0),
nvl(DI.settle_fee,0)
from AI,DI
where AI.CUST_CODE = DI.cust_code(+)
) a
经查:原因是
select AI.cust_code,AI.cust_name,nvl(AI.account_fee,0),nvl(AI.settle_fee,0),
0,0,0,0,nvl(DI.account_fee,0),nvl(DI.settle_fee,0),
nvl(DI.account_fee,0),
nvl(DI.settle_fee,0)
from AI,DI
where AI.CUST_CODE = DI.cust_code(+)
在查询的时候列明重复了,导致在查询还有重复列明的临时表时会报“ORA-00918: column ambiguously defined 未明确定义列”的错误信息
分享到:
相关推荐
ora-01033:oracle initialization or shutdown in progress 解决方法 ora-01033:oracle initialization or shutdown in progress 解决方法 ora-01033:oracle initialization or shutdown in progress 解决方法 ora-...
ORA-00031:标记要终止的会话解决方案; ORA-00031:标记要终止的会话解决方案;
ORA-32001:write to spfile requested but no spfile is in use请求写入spfile,但没有使用spfile的解决方法 在输入以下语句中报了这样的错误: SQL>alter system set control_files=’/u01/app/oracle/oradata/prod/...
在运行查询SELECT * FROM V$SESSION 会出现ORA-29275:部分多字节字符的错误,这是什么原因开始我不得其解,网上也没有介绍什么好办法。本文给出答案。
ORA-12154: TNS: 无法解析指定的连接标识符的解决方法
ORA-01036:非法的变量名/编号 oracle特有的错误
调整参数后引起,ORA-00838: Specified value of MEMORY_TARGET is too small, needs to be at least 3 2768M 的解决方案
oracle 12 c ORA-01017: 用户名/口令无效; 登录被拒绝
-- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... -- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... -- 解决ORA-00904: "WMSYS"."WM_CONCAT": 标识符无效 的文件包....... ...
oracle报错ora-12541:TNS无监听程序
NULL 博文链接:https://3w1h.iteye.com/blog/1211779
解决ORACLE TNS: 无法解析指定的连接标识符; 里面有步骤
ora-12514:TNS:监听程序当前无法识别连接描述符中请求的服务bug,解决文档.
CLOB字段类型报错 ORA-01704:文字字符串过长的解决
oracle19c缺少的函数
NULL 博文链接:https://springlin.iteye.com/blog/1520668
ORA-27303: additional information: MTU could not be verified. Did not receive valid message. These errors are caused by more aggressive checking introduced in 10.2.0.4. Likelihood of Occurrence ...
有关表死锁的详细图片 博文链接:https://meteor-1988.iteye.com/blog/1568695
错误描述:oracle远程连接服务器出现 ORA-12170 TNS:连接超时 错误检查:有很多是oracle自身安装的问题,但是我这里服务器配置正常,监听正常,服务正常,远程可以ping通服务器。 这里主要是防火墙问题,解决办法: ...