[EMAIL PROTECTED] 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   [EMAIL PROTECTED]   http://funkturm.homeip.net/~peter


---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to