小编典典

各列定义不明

sql

我越来越:

ORA-00918:列的含义不明确的00918。00000-“列的含义不明确的”

每当我尝试运行时:

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;

该错误仅在包括以下内容时显示:

inner join super_employee se
on se.id = ssl.employee_id;

有任何想法吗?


阅读 228

收藏
2021-03-17

共1个答案

小编典典

显然,不止一个表具有first_name和/或last_name其中,可能是super_studentsuper_employee

使用您很好定义的表别名:

select ss.first_name as student_first_name, 
       ss.last_name as student_last_name
2021-03-17