title: use join count in calculation in select
body: <pre><code>SELECT e.qty * e.unit_cost * e.unit_no * (e.factor/100) AS Ext_price, c.cost_type, c.cost_dt, c.internal_cost_amt, c.client_cost_amt
  FROM equipment e
  LEFT JOIN CostAllocation c ON (c.object_row_id = e.row_id)
  </code></pre>
  
  <p>I now want to divide the <code>Ext_price</code> by the number of <code>CostAllocation</code> rows that match the equipment row.  How would I do that?</p>