title: SQL Server returns "Cannot perform an aggregate function on an expression containing an aggregate or a subquery"
body: <p>I want to get the total of the column 'Item Sold', but it is giving me the error, is it the right query? What could be the correct query?</p>
  
  <pre><code>SELECT m.m_name as 'Food Item', SUM(od.od_quantity*m.m_price) as 'Items Sold', 
         Sum(Sum(od.od_quantity*m.m_price)) as 'Total' 
  FROM orderDetails od left join 
       menu m 
       on od.od_menuID=m.m_id left join 
       orders o 
       on od.od_id=o.o_id 
  WHERE o_date &gt;= DATEADD(day,-30,GETDATE())  and   
        o_date &lt;= getdate() 
  group by m.m_name,m.m_price 
  order by SUM(od.od_quantity) DESC
  </code></pre>