title: Ambiguous column name error : SQL count, join, group by
body: <p>I have two tables as below, one table has number of available units (stock), I'm trying to return the stock count of each product category, and joining it with secondary table to view the description and price etc.</p>
  
  <p>When I run the below query, I get "Ambiguous column name 'productID'." </p>
  
  <p>What am I doing wrong? </p>
  
  <p>SQL Query:</p>
  
  <pre><code>select productID, count (stock)as available_count
  from product_units
  join  product_type ON product_type.description = product_units.productID
  group by productID  
  </code></pre>
  
  <p>This returns an error:</p>
  
  <blockquote>
    <p>Ambiguous column name 'productID'.</p>
  </blockquote>
  
  <p>Table product_type</p>
  
  <pre><code>productID  description  price 
  101        tent         20.00
  102        xltent       50.00
  </code></pre>
  
  <p>Table product_units </p>
  
  <pre><code>unitID  productID stock
  1       101       1
  2       101       1
  3       101       1
  4       102       1
  </code></pre>
  
  <hr>
  
  <p>Orginal SQL query to get stock count, which works: </p>
  
  <pre><code>select productID, count (stock)as available_count
  from  product_units
  group by productID
  </code></pre>
  
  <p><strong>I'm using SQL Server 2008 R2 with Coldfusion</strong></p>