[我正在尝试使用SQL Developer中的联接从多个表中检索数据,但出现错误ORA-00933:SQL命令未正确结束

问题描述 投票:-1回答:2
select 
    e.first_name, e.last_name, 
    e.first_name || e.last_name "Name",
    d.department_name, d.manager_id,
    l.country_id, l.city
from 
    employees e
join 
    departments d on e.department_id = d.department_id
join 
    locations l on d.location_id = l.location_id
where 
    d.manager_id = &d.manager_id;
sql join oracle-sqldeveloper alias where-clause
2个回答
0
投票

删除并在您的where语句中,我猜这是问题所在。

“名称”,d.department_name,d.manager_id,l.country_id,l.city来自雇员e在e.department_id = d.department_id上加入部门d.location_id = l.location_id 其中d .manager_id = d.manager_id;


0
投票

尝试一下,检查是否对您有帮助;)

select 
e.first_name, e.last_name, 
concat(e.first_name, ' ', e.last_name) "Name",
d.department_name, d.manager_id,
l.country_id, l.city
from 
employees e
join 
departments d on e.department_id = d.department_id
join 
locations l on d.location_id = l.location_id
where 
d.manager_id = &d.manager_id;
© www.soinside.com 2019 - 2024. All rights reserved.