Mysql
 sql >> Datenbank >  >> RDS >> Mysql

MYSQL-SUMMENGRUPPE NACH

GROUP BY muss vor ORDER BY stehen:

  SELECT SUM(g.points) 
    FROM GRADES g
   WHERE g.date < 'thedate' 
GROUP BY g.assignmentid
ORDER BY g.date DESC