ORA-00918: column ambiguously defined 未明确定义列

来源:互联网 发布:数据监控系统页面 编辑:程序博客网 时间:2024/06/07 07:51

在编写sql语句中 使用嵌套语句进行查询  

出现异常:ORA-00918: column ambiguously defined

异常原因:select 【表名】.*与嵌套的sql语句中有变量名重复

以下是例子

SELECT rt.*, ROWNUM row_numFROM(SELECTmtOverhaulStandard.*, dept.dept_name,machine.machine_no,machine.machine_nameFROMMt_Overhaul_Standard mtOverhaulStandard,Sys_deptment dept,Mes_machine machineWHEREmtOverhaulStandard.dept_id = dept.deptid (+)) rtWHEREROWNUM <= 20

就是因为mtOverhaulStandard.*中包含machine_name 与之后的machine.machine_name名字重复 

导致了列定义不明确

原创粉丝点击