This should do it...
SELECT A.Name
FROM A INNER JOIN
B ON A.ID = B.ID
WHERE (B.[Group] IN ('elks', 'moose', 'eagles'))
GROUP BY A.Name
HAVING (COUNT(A.Name) = 3)
It's basically a nested select statement with the appropriate criteria
applied. If you have any questions let me know...
-----Original Message-----
From: Gary S. Mackay [mailto:">Gary@edisoninfo.com]
Sent: Monday, May 15, 2000 3:16 PM
To: ">ale@ale.org
Subject: [ale] SQL statement problem
How would I create an SQL statement for the 'AND' condition? Let me
explain...
I have two tables, tableA (id,name,addr,city,state,zip) and tableB
(tableAid,group). Table A is just a list of names, and table B is a list of
groups that each person in table A belongs to. How do I create a SQL
statement
that will show everyone in table A that has three particular records in
table
B? (In english "Show me everyone that is a member of the elks,moose,and
eagles
clubs") It's easy to show everyone that is a member of any one of the
requested groups, but how do I show people that have all three records in
table B?
TIA,
- Gary
_______________________________________________
Edison Information Technologies
P.O. Box 554
Milan, OH 44846-0554
419.499.7040
www.EdisonInfo.com
">Gary@EdisonInfo.com
_______________________________________________
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message
body.
--
To unsubscribe: mail ">majordomo@ale.org with "unsubscribe ale" in message body.