MySQL Forums
Forum List  »  General

Re: bug (5.6.22) in ADDTIME?
Posted by: Peter Brawley
Date: January 26, 2015 12:51PM

> can't group by that, because I'm trying to get the SUM of the different "duracion"'s of every codasig_cita

Eh? According to you, the result obtained by adding a.hora_cita to the Group By clause is correct.

If there is a real need not to add a.hora_cita to the Group By clause, isolate aggregation in a subquery eg ...

select a.codasig_cita, addtime(a.hora_cita, b.timesum)
from asig_cita2 a
join (
  select a.codasig_cita, sec_to_time(sum(time_to_sec(pe.duracion))) as timesum
  from asig_cita2 a, citas_proc_empl2 cpe, proc_empl2 pe
  where cpe.codproc_empl=pe.codproc_empl and a.codasig_cita=cpe.codasig_cita
  group by a.codasig_cita, a.hora_cita
) b using(codasig_cita);

> why in 5.0 throws the correct result?

Probably a bug, see http://dev.mysql.com/doc/refman/5.6/en/group-by-handling.html.

Options: ReplyQuote


Subject
Written By
Posted
January 23, 2015 10:46AM
January 23, 2015 12:56PM
January 23, 2015 05:48PM
Re: bug (5.6.22) in ADDTIME?
January 26, 2015 12:51PM
January 26, 2015 03:02PM
January 23, 2015 05:55PM
January 26, 2015 03:17PM
January 26, 2015 03:54PM
January 26, 2015 06:35PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.