[AccessD] SQL challenge

Stuart McLachlan stuart at lexacorp.com.pg
Sun Apr 24 18:56:02 CDT 2005


Just had a look at the article referenced and I see the aim is to use 
EXISTS (even though the EXISTS  seems like overkill).

Looks like you wrote you article without really understanding your subject. 
:-)  

In your own words from the article "SQL's EXISTS predicate specifies a 
subquery and then compares a value against the existence of one or more 
rows in that subquery. The subquery returns True when the subquery contains 
any rows and False when it doesn't."

So you need to establish a relationship within the subquery between the 
master record and the subquery records so that you can evaluate True or 
False  FOR EACH instance of  Species.SpecID. You need something like:

> WHERE
> NOT EXISTS
> (SELECT CBCData.SpecID From CBCData  WHERE CBCData.SpecID = Species.SpecID and CBCData.CountID = 57)

-- 
Stuart





More information about the AccessD mailing list