title: Using OR Condition in JOINS
body: <p>I'm fetching records by doing some multiple Joins. I need to add one more with OR condition.</p>
  
  <p>There is a table <code>Payment</code>. From <code>Payment</code> have to join with:</p>
  
  <ul>
  <li>table Package1(if Payment.PaymentTypeID=1)  OR with </li>
  <li>table Package2(if Payment.PaymentTypeID=3). </li>
  </ul>
  
  <p>Both the tables Package1 and Package2 have a column VoucherID and have to be fetched based on the above condition. I can do it by below query using Union or Union All, but please let me know if I can do it without using UNion or Union All.</p>
  
  <pre><code>select  P1.VoucherID  from Payment P
  inner join Package1 P1 on P1.empid=P.empid and P.PaymentTypeID=1
  
  union all
  
  select  P2.VoucherID  from Payment P
  inner join Package1 P2 on P2.empid=P.empid and P.PaymentTypeID=3
  </code></pre>