【发布时间】:2017-12-07 17:30:02
【问题描述】:
我正在使用 oracle 11g 并尝试执行此请求
select code_mod,INTITULE,code_et,nom ,avg(note)
from note,exam,module,etudiant
where note.CODE_EX = exam.CODE_EX
and EXAM.CODE_MOD=MODULE.CODE_MOD
and NOTE.CODE_ET = ETUDIANT.CODE_ET
group by code_mod,code_et
order by code_mod;
但它说!
ORA-00918: column ambiguously defined
00918. 00000 - "column ambiguously defined"
*Cause:
*Action:
Error on line 6, colunn 19
这有什么问题?如果我执行这个请求,它会起作用
select *
from note,exam,module,etudiant
where note.CODE_EX = exam.CODE_EX
and EXAM.CODE_MOD=MODULE.CODE_MOD
and NOTE.CODE_ET = ETUDIANT.CODE_ET;
【问题讨论】:
-
Bad habits to kick : using old-style JOINs - 旧式 逗号分隔的表格列表 样式已替换为 ANSI 中的 proper ANSI
JOIN语法-92 SQL 标准(25 年前!),不鼓励使用它
标签: sql oracle oracle11g ora-00918