O
operator
I have two tables, Project and Contact, with a one-to-many
relationship. The columns that link these tables are A and X,Y,Z
respectively. A, X, Y, and Z are of type Text. I want a query to return
all Project records that do not have a Contact record associated with
them. Here is what I thought would work:
select distinct Project.* from Project, Contact
where Project.A not like Contact.X and Project.A not like Contact.Y and
Project.A not like Contact.Z
This seems to return everything and I'm beginning to understand why. I
am at a loss of how to achieve my goal though. Any
thoughts/suggestions?
(Background info: There is currently a query that returns projects and
their associated contacts. However, projects that do not have contacts
are omitted and thus my need for this sort of "exception list".
relationship. The columns that link these tables are A and X,Y,Z
respectively. A, X, Y, and Z are of type Text. I want a query to return
all Project records that do not have a Contact record associated with
them. Here is what I thought would work:
select distinct Project.* from Project, Contact
where Project.A not like Contact.X and Project.A not like Contact.Y and
Project.A not like Contact.Z
This seems to return everything and I'm beginning to understand why. I
am at a loss of how to achieve my goal though. Any
thoughts/suggestions?
(Background info: There is currently a query that returns projects and
their associated contacts. However, projects that do not have contacts
are omitted and thus my need for this sort of "exception list".