List:General Discussion« Previous MessageNext Message »
From:BobSharp Date:March 17 2009 4:42pm
Subject:Negated SELECT query
View as plain text  
3 tables are related by one-many links. 
Employees  ---<-  Assets  ---<-  Maintenance 

Employees can be assigned  => 0   Assets 
Assets can have  => 0  occurances of  Maintenance.  

Assets table contains  EmployeeIDs  and  MaintenanceIDs,  
but no Foreign Key contraints.  

Queries ...  
1)  which Employees do not have any  Assets ? 
2)  which  Assets  have not had any  Maintenance ? 
These have been written successfully with Sub-Queries,  

I would like to know how they can be done with only JOINs  ? 
(that also means  without the EXCEPT statement) 
Is that too much of a challenge ?      (MySQL  5.0.67)  

I am using the free version of SPAMfighter.
We are a community of 6 million users fighting spam.
SPAMfighter has removed 12747 of my spam emails to date.
Get the free SPAMfighter here:

The Professional version does not have this message

Negated SELECT queryBobSharp17 Mar
  • Re: Negated SELECT queryPerrin Harkins17 Mar
  • RE: Negated SELECT queryJohn Bonnett17 Mar
  • Re: Negated SELECT queryBobSharp18 Mar