bhuvansql(at)yahoo(dot)com writes:
> 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'.
SELECT * FROM employee WHERE emp_id NOT IN (SELECT emp_id FROM salesorder);
or, slightly uglier but possibly faster
SELECT * FROM employee WHERE NOT EXISTS
(SELECT 1 FROM salesorder WHERE salesorder.emp_id = employee.emp_id);
--
Peter Eisentraut peter_e(at)gmx(dot)net http://funkturm.homeip.net/~peter