> >  Now, i need to get the details of all employees who did 
> >  receive NONE of the salesorders. ie.. i wish to select the 
> >  records of table 'employee' whose 'emp_id' are not 
> >  there in table 'salesorder'.
> >  
> >  I need to accompolish in a single query!

This should work:

select e.emp_id
from employee as e left join salesorder as s
  on e.emp_id = s.emp_id
where s.emp_id is null;


-- Joe


---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to