title: How to join two tables on multiple columns using OR condition in bigquery SQL
body: <p>Lets say I have two tables.
  First table shown below:</p>
  <p><code>tableA</code></p>
  <p><a href="https://i.stack.imgur.com/gcUR7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gcUR7.png" alt="enter image description here" /></a></p>
  <p>Second table
  <code>tableB</code></p>
  <p><a href="https://i.stack.imgur.com/8ThwO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8ThwO.png" alt="enter image description here" /></a></p>
  <p>Now I want to write a query That will join the two tables above on either name OR email OR phone.</p>
  <p>Something like:</p>
  <pre><code>SELECT * FROM tableA
  LEFT JOIN tableB
  ON
  (tableA.name_A = tableB.name_B OR tableA.email_A = tableB.email_B OR tableA.phone_A = tableB.phone_B)
  </code></pre>
  <p>And it should produce a table something like this</p>
  <p><a href="https://i.stack.imgur.com/YGw4x.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YGw4x.png" alt="enter image description here" /></a></p>
  <p>If you notice,</p>
  <ol>
  <li>John matches rows between tableA and tableB on name.</li>
  <li>Ally/allie matches rows between tableA and tableB on email.</li>
  <li>Sam/Samual matches rows between tableA and tableB on phone</li>
  </ol>
  <p>When I try to do this same query though I receive an
  error that says LEFT OUTER JOIN cannot be used without a condition that is an equality of fields from both sides of the join.</p>
  <p>I am using BigQuery.
  Please help, cheers</p>