title: "ambiguous column name" in SQLite INNER JOIN
body: <p>I have two tables in a SQLite DB, INVITEM and SHOPITEM. Their shared attribute is ItemId and I want to perform an INNER JOIN. Here's the query:</p>
  
  <pre><code>    SELECT  INVITEM.CharId AS CharId, 
              INVITEM.ItemId AS ItemId 
        FROM  (INVITEM as INVITEM 
  INNER JOIN  SHOPITEM AS SHOPITEM 
          ON  SHOPITEM.ItemId = INVITEM.ItemId)
       WHERE  ItemId = 3;
  </code></pre>
  
  <p>SQLite doesn't like it :</p>
  
  <pre><code>SQL error: ambiguous column name: ItemId
  </code></pre>
  
  <p>The error goes away if I write <code>WHERE INVITEM.ItemId = 3</code>, but since the WHERE condition is more or less user-specified, I rather make it work without having to specify the table. NATURAL JOIN seems to solve the issue, but I'm not sure if the solution is general enough (ie I could use in this case, but I'm not sure if I can use in every case)</p>
  
  <p>Any alternate SQL syntax that would fix the problem?</p>