title: How to replace an OR statement from a join in sql server
body: <p>I have the following query that uses an or statement on a join, so basically if one condition on the join isn't met it must check the next condition. The problem is that with the OR statement it takes really long to run but when I remove one of the OR conditions it runs instantly. is there a better way to do this with both conditions without using the OR statement so it would speed up the query</p>
  
  <pre><code>  select t5.TransactionNumber
          ,t4.ID
          ,t3.[Entry] AS Amount 
          ,t2.Address AS AddressDetail
          ,t1.PhoneNumber   AS  ContactNumber
    FROM Table1 t1 (NOLOCK)
    JOIN Table2 t2 (NOLOCK) ON t2.FicaID = t1.FicaId 
    inner  join Table3 t3 (NOLOCK) ON (t3.ID = t2.ID AND t3.Code = t2.Code) or (t3.TypeID = t2.TypeID)  //on this join i have an or statement if one condition isnt met it must check the next condition
    LEFT JOIN Table4 t4 (NOLOCK) ON t4.Result = t3.Result
    LEFT JOIN Table5 t5 (NOLOCK) ON t5.AccNum = t3.AccNum
    where t1.date&gt;'2018-09-01' and t1.date&lt;'2018-09-30'
  </code></pre>