title: Why I am getting Ambiguous field name 'x' in JOIN
body: <blockquote>
    <p>Fact 1 - I am successfully running simple query like below in BigQuery Web UI</p>
  </blockquote>
  
  <pre><code>SELECT
    a.id AS id,
    b.v AS v,
    c.w AS w
  FROM (SELECT 1 AS id, "abc" AS x, "xyz" AS y) AS a
  LEFT JOIN (SELECT "abc" AS x, "111" AS v) AS b ON a.x = b.x
  LEFT JOIN (SELECT "xyz" AS y, "222" AS w) AS c ON a.y = c.y  
  </code></pre>
  
  <blockquote>
    <p>Fact 2 - When I try to write result [of very same query] to table with below options  - it <strong>fails!</strong>  </p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/CHM7R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CHM7R.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p>Fact 3 - Same query to table with below options  - <strong>succeeded</strong>!   </p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/zu25o.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zu25o.png" alt="enter image description here"></a></p>
  
  <blockquote>
    <p><strong>Question</strong> - Why I am getting this error?   </p>
  </blockquote>
  
  <p><strong>Note</strong>:<br>
  I was asked this question outside of SO, so decided to share here.<br>
  As you can see "workaround" is "found" - so please do not suggest how to re-write the query if it is not accompanied with explanation/answer on actual question. </p>