Mysql
 sql >> Database >  >> RDS >> Mysql

SOMMA MYSQL GRUPPO PER

GROUP BY deve venire prima di ORDER BY:

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