Re: How can we match a condition among 2 diff. tables? - Mailing list pgsql-sql

From Stephan Szabo
Subject Re: How can we match a condition among 2 diff. tables?
Date
Msg-id Pine.BSF.4.21.0107130842510.9706-100000@megazone23.bigpanda.com
Whole thread Raw
In response to How can we match a condition among 2 diff. tables?  (bhuvansql@yahoo.com)
List pgsql-sql
Something like?

select employee.* from employee where
not exists (select * from salesorder wheresalesorder.emp_id=employee.emp_id);

On Fri, 13 Jul 2001 bhuvansql@yahoo.com wrote:

> 
>  
>  Hi,
>  
>  Consider the below...
>  
>   table 'employee' with unique 'emp_id',
>   table 'salesorder' with 'emp_id' and unique 'sales_id' 
>  
>  Remember, both tables include some more different fields.
>  
>  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!



pgsql-sql by date:

Previous
From: A_Schnabel@t-online.de (Andre Schnabel)
Date:
Subject: Re: How can we match a condition among 2 diff. tables?
Next
From: "Ari Nepon"
Date:
Subject: You have an error in your SQL syntax near '' at line 1