简体   繁体   English

Oracle中的左外部联接

[英]left outer join in Oracle

I am implementing a left outer join with the customer table and am joining it with the payroll table. 我正在与客户表实现左外部联接,并将其与工资表联接。 I am having trouble with Oracle recognizing that I only want the employees that are not current on their audits. 我对Oracle感到困惑,因为我认识到我只希望那些尚未接受审计的员工。

SELECT e.E_Name, e.Phone
FROM E_Name.Employee AS e
LEFT OUTER JOIN E_Name.Payroll AS p
ON e.E_Name = p.E_Name
WHERE p.audit != 'current';

My error: 我的错误:

SQL Error: ORA-00933: SQL command not properly ended

How do I solve this? 我该如何解决?

Assuming that you have columns with the same name of your schema ( E_Name ), you simply have to remove the as : 假设您的列具有与架构相同的名称( E_Name ),则只需删除as

SELECT e.E_Name, e.Phone
FROM Employee  e
LEFT OUTER JOIN Payroll  p
ON e.E_Name = p.E_Name
WHERE p.audit != 'current';

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM