title: Not A Group By Expression Error With Departments and Commissions
body: <p>Okay guys here is the question.
  I have to list the department ID, department name, count of sales reps, and average commission rate for each department. Also I need to Group by department, and sort by average commission rate in ascending order.  </p>
  
  <p>I am receiving an error at line 1 under the De.Dept_ID saying that is not a group by expression</p>
  
  <p>Here is my code:</p>
  
  <pre><code> SELECT DE.Dept_ID as DeptID, Dept_Name as DeptName, COUNT(SR.Sales_Rep_ID) as SalesRepCount,
   Comm_Rate as AvgCommRate  
   FROM DEPT_arb DE, SALES_REP_arb SR, COMMISSION_arb C
   WHERE DE.Dept_ID = SR.Dept_ID AND
   Comm_Rate = (SELECT AVG(Comm_Rate) FROM COMMISSION_arb WHERE SR.Comm_Class = C.Comm_Class)
   GROUP BY Dept_Name
   ORDER BY C.Comm_Rate;
  </code></pre>
  
  <p>I appreciate the input</p>