Subject Re: Performance troubles
Author Ali Gökçen
select contactno from contacts c
where state in(1,2)
AND
exists(select sum(giftvalue)
from gifts
where contactno = c.contactno
and someotherfield = 'somevalue'
having sum(giftvalue)>=100
)

My "AND" eaten by some by some brain bugs.