title: Query to find an average weighted price
body: <p>I have a table in Oracle with multiple rows per a given part.  Each row has a quantity and a price associated with it.  There is also a total quantity that the set of rows for a given part adds up to.  Below is a sample of the data.  What I need is to get the average weighted price for the part.  For example if a quantity of 100 of a part has a price of 1 and a quantity of 50 has a price of 2 the weighted average price is 1.33333333</p>
  
  <pre><code>PART   TOTAL_QTY  QTY   PRICE_PER
  ----------------------------------
  part1  317        244   27
  part1  317        40    53.85
  part1  317        33    24.15
  </code></pre>
  
  <p>Ideas?</p>