title: Query of max order within 10 year from the first recorded order date
body: <p>I am supposed to retrieve the max order from within 10 years of the first recorded order date.  I tried the following query:</p>
  
  <pre><code>SELECT C.NAME, O.PRICE FROM CUSTOMERS C
      LEFT JOIN ORDERS O ON C.ORDER_ID = O.ID
      WHERE O.PRICE = (SELECT MAX(PRICE) FROM (SELECT * FROM ORDERS O2 WHERE O2.ORDER_DATE BETWEEN MIN(O2.ORDER_DATE) AND DATEADD(year, 10, MIN(O2.ORDER_DATE))))
  </code></pre>
  
  <p>but it gives the error of:</p>
  
  <blockquote>
    <p>not derivable from table.</p>
  </blockquote>
  
  <p>Could somebody help to point out my mistake?</p>