Skip to content Skip to sidebar Skip to footer

Postgresql Error: Column "manager" Does Not Exist

Can anyone please tell why is this error popping? Is there something wrong in my code? Which Manager (ename) works only with employees who don't have the same job as he has? Select

Solution 1:

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 NOTIN(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
    WHERENOTEXISTS(SELECT1FROM emp em
                         WHERE em.empno = e.mgr
                             AND em.job = e.job);

Post a Comment for "Postgresql Error: Column "manager" Does Not Exist"