title: subqueries foxpro
body: <pre><code>SELECT category, SUM(price*amount);
   FROM dan2.dbf WHERE;
    between(date_p, {^2014-01-01}, {^2014-12-31});
      GROUP BY category
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/QlxqI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QlxqI.png" alt="enter image description here"></a></p>
  
  <p>This query finds the sum of categories and some conditions on date. I need to find the maximum of the sum (by the subkuery).</p>