0

我正在加入 PL/SQL 中的 3 个表,即员工、部门和经理的另一名员工。但是当我运行脚本时出现此错误

Error report:
ORA-06550: line 19, column 9:
PL/SQL: ORA-00918: column ambiguously defined
ORA-06550: line 9, column 3:
PL/SQL: SQL Statement ignored
06550. 00000 -  "line %s, column %s:\n%s"
*Cause:    Usually a PL/SQL compilation error.
*Action:

我是 PL/SQL 的新手,所以无法理解这些错误的含义。

这是开始块内的选择语句,我得到错误

   select e.first_name||' '||e.last_name AS Employee ,
          m.first_name||' '||m.last_name AS Manager ,
          e.job_id AS jobemp , 
          d.department_name AS Department ,
          e.salary AS Salary
  into ename, manager, jobid, depn, sal
  from employees e join departments d 
          on (e.department_id = d.department_id)
        join employees m
          on (e.manager_id = m.employee_id)
  where salary = (select min(salary) from employees)
  ;

谁能帮我识别这个错误?提前致谢。

4

1 回答 1

4

salary在 where 子句中指定来自哪个表

    select e.first_name||' '||e.last_name AS Employee , 
          m.first_name||' '||m.last_name AS Manager , 
          e.job_id AS jobemp ,  
          d.department_name AS Department , 
          e.salary AS Salary 
  into ename, manager, jobid, depn, sal 
  from employees e join departments d  
          on (e.department_id = d.department_id) 
        join employees m 
          on (e.manager_id = m.employee_id) 
  where e.salary = (select min(salary) from employees); 
于 2012-10-11T08:36:03.150 回答