title: Oracle find total profit for each month in a certain year
body: <h2>Question:</h2>
  
  <p>For each month in 2014, display the total profit (i.e. using the attributes purchasedPrice and agreedPrice) generated from car sales only. </p>
  
  <p>Tables:</p>
  
  <h2>Car</h2>
  
  <pre><code>(VIN, dateAcquired, yearBuilt, purchasedPrice, askingPrice, currentMileage, modelNo)
  </code></pre>
  
  <h2>Sales Transaction</h2>
  
  <pre><code>(VIN, custID, agentID, dateOfSale, agreedPrice)
  </code></pre>
  
  <h2>My incorrect code:</h2>
  
  <pre><code>select c.dateacquired, st.agreedprice - c.purchasedprice as "Total Profit" 
  from salestransaction st, car c
  where c.VIN = st.VIN
  and extract(year from c.dateacquired) = '2014'
  group by extract(month from c.dateacquired), st.agreedprice - c.purchasedprice;
  </code></pre>
  
  <p>Could someone please tell me what I'm doing wrong?</p>
  
  <p>I am getting the following error:</p>
  
  <blockquote>
    <p>not a GROUP BY expression at line 01</p>
  </blockquote>