简体   繁体   中英

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.

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 :

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';

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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