Your string literals should be enclosed in single quotes instead of double quotes.
SELECT e.ename
FROM emp e
WHERE e.job = 'MANAGER'
AND e.mgr NOT IN(SELECT empno
FROM emp
WHERE job = 'MANAGER');
Also, based on your title, I wonder if this query shouldn’t be written more generically to account for any job in common? Something like:
SELECT e.ename
FROM emp e
WHERE NOT EXISTS(SELECT 1
FROM emp em
WHERE em.empno = e.mgr
AND em.job = e.job);
2
solved PostgreSQL error: Column “MANAGER” does not exist [duplicate]