Reputation: 37
I'm getting:
ORA-00918: column ambiguously defined 00918. 00000 - "column ambiguously defined"
Whenever I try to run:
select
first_name as student_first_name,
last_name as student_last_name
from super_student ss
inner join sub_distance_learning sdl
on sdl.student_id = ss.id
inner join sub_academic_tutor sat
on sat.id = sdl.academic_tutor_id
inner join super_sub_lecturer ssl
on ssl.id = sat.lecturer_id
inner join super_employee se
on se.id = ssl.employee_id;
The error only shows when this is included:
inner join super_employee se
on se.id = ssl.employee_id;
Any ideas?
Upvotes: 1
Views: 367
Reputation: 1269653
Obviously, more than one table has first_name
and/or last_name
in it, presumably super_student
and super_employee
.
Use the table aliases that you nicely defined:
select ss.first_name as student_first_name,
ss.last_name as student_last_name
Upvotes: 4