title: How can I sum a result in sql when the other results of other column are the same?
body: <p>Hi and sorry if I don't do the question the correct way </p>
  
  <p>I have this query : </p>
  
  <pre><code>SELECT
  t4.tar_nombre as nombre_tarea,
  t2.rdi_fechacti as fecha_actividad,
  t3.rea_hrstarea as horas_trabajadas
  
  FROM
      act_usuario t1
  INNER JOIN
      act_regisdiario t2
  ON
      (t2.usu_id = t1.usu_id)
  INNER JOIN
      act_registtarea t3
  ON
      (t3.rdi_id = t2.rdi_id)
  INNER JOIN
      act_tarea t4
  ON
      (t4.tar_id = t3.tar_id)
  WHERE
      t4.usu_id = 4 
  GROUP BY
  
      t3.rea_id
  
  ORDER BY
      t2.rdi_fechacti
  </code></pre>
  
  <p>And the query print this : </p>
  
  <p><a href="https://i.stack.imgur.com/MMrbK.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MMrbK.jpg" alt="enter image description here"></a></p>
  
  <p>So, I need when in "fecha_Actividad" exist the same "nombre_actividad" , thats only show me one "fecha_actividad" and the sum of "horas_trabajadas".</p>
  
  <p>For example the query show this:</p>
  
  <p><a href="https://i.stack.imgur.com/jU71c.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jU71c.jpg" alt="enter image description here"></a></p>
  
  <p>But I need this (because the same "nombre_tarea" is in the same date):</p>
  
  <p><a href="https://i.stack.imgur.com/ee9oL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ee9oL.jpg" alt="enter image description here"></a></p>
  
  <p>The reference:</p>
  
  <p><a href="https://i.stack.imgur.com/LPLQZ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LPLQZ.jpg" alt="enter image description here"></a></p>
  
  <p>Sorry my english.</p>