| Kerry Sainsbury offered:
|
| select name from example where attributeid = 5
| and name in ( select name from example where attributeid = 11 )


That could be nice and slow on Interbase (as well as returning duplicates).

Try this:

create index ix1_Example on Example (AttributeID, Name);

select distinct e1.Name from Example e1
where e1.AttributeID = 5 and
exists(select * from Example e2 where e2.Name = e1.Name and e2.AttributeID =
11);


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

Reply via email to