hi all,
here is my sql script.
select distinct b.TrxhdID
from CustomerMaster a(nolock), TransactionHd b(nolock), TransactionDetail c(nolock), TimeSlot d(nolock), CustomerAgent e
where a.CustomerCode = b.CustomerCode
and b.TrxhdId = c.TrxhdId
and c.timeSlotID = d.timeSlotID
and d.ProductId = '1787'
and ((a.CustomerName like 'test') )
or ( e.TrxHdID = b.TrxhdID and b.TrxhdID in ( select distinct TrxHdID from CustomerAgent e(nolock) where e.CustomerName like 'test' )) --new add
any idea? it take very long time to execute after i add the or script.