Yes, you just build the SQL on the fly...

If there are seven attributes you want to check for then...
select Name
from Table
where GroupID in (1,2,3,4,5,6,7)
group by Name
having count(GroupID) = 7;

Dave.

-----Original Message-----
From: Wade Auchterlonie [mailto:[EMAIL PROTECTED]]
Sent: Thursday, 4 November 1999 18:29
To: Multiple recipients of list database
Subject: RE: [DUG-DB]: SQL from hell.... (was something else...)


| select Name
| from Table
| where GroupID in (1,7)
| group by Name
| having count(GroupID) = 2;
|
| This is brilliant, wish I'd thought of it :)
|
| Dave.

... But it doesn't solve the original question.

I quote this part from the original message:

"Basically, a person can have any number of attribute ID's (possibly even
the same one twice)."

Special emphasis on the "same one twice" which renders the technique above
flawed

---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz


---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
---------------------------------------------------------------------------
  New Zealand Delphi Users group - Database List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz

Reply via email to