When using the SUM() function, how does MySQL add times? -


in database, have field called flighttime. contains durations of flights, ie: 1:31, 0:45, 0:29. when use sum() function of mysql add times, gives me strange number, xxxxx. isn't in time format 1 expect xx:xx.

anyone know how mysql adds times? if so, how can convert number gives me format xx:xx?

thanks!

if want add times in mysql should use addtime() function in mysql not sum() function.

mysql> select addtime('2007-12-31 23:59:59.999999', '1 1:1:1.000002');     -> '2008-01-02 01:01:01.000001' mysql> select addtime('01:00:00.999999', '02:00:00.999998');     -> '03:00:01.999997' 

the synatx addtime(expr1,expr2) cant add 3 times together.


Comments