Received: from mailsys01.intnet.net (antares.intnet.net [198.252.32.143]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6DIvPa25168 for ; Fri, 13 Jul 2001 14:57:25 -0400 (EDT) (envelope-from joseph.conway@home.com) Received: from [206.19.64.3] (HELO jecw2k1) by mailsys01.intnet.net (CommuniGate Pro SMTP 3.3.2) with SMTP id 11372333; Fri, 13 Jul 2001 14:56:17 -0400 Message-ID: <009a01c10bcd$a5383510$47d310ac@jecw2k1> From: "Joe Conway" To: Cc: References: Subject: Re: How can we match a condition among 2 diff. tables? Date: Fri, 13 Jul 2001 11:57:19 -0700 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 X-Archive-Number: 200107/179 X-Sequence-Number: 3974 > > 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