title: Sum row with same id (mysql)
body: <p>( the last )I would like to  sum  row with the same user_id ( for the column ponderation, I dont need to have other column , only user_id and ponderation)  </p>
  
  <p><img src="https://i.stack.imgur.com/7Hon9.png" alt="enter image description here"></p>
  
  <p>My query </p>
  
  <pre><code>SELECT  students_group.user_id,scores.result ,exam.name,exam.ponderation,exam.id, (scores.result * exam.ponderation) / totpond.totalpond as ponderation
  from (
  select sum(exam.ponderation)  as totalpond from scores
  left join exam on exam.id = scores.exam_id
  left join teacher_group on teacher_group.id = exam.teacher_group_id
  left join groups on  groups.id = teacher_group.group_school_id
  left join students_group on students_group.user_id = scores.user_id
  where teacher_group.id = 54
  group by students_group.user_id
  
   ) as totpond,scores
  left join exam on exam.id = scores.exam_id
  left join teacher_group on teacher_group.id = exam.teacher_group_id
  left join groups on  groups.id = teacher_group.group_school_id
  left join students_group on students_group.user_id = scores.user_id
  
  where teacher_group.id = 54
  group by scores.id
  order by students_group.user_id
  </code></pre>
  
  <p>Is it to possible to do that with my query or need to use php ?  Can someone help me please ?  thx  :)</p>