If I have a MySQL table "tempt" with an ID column and a "tTime" column of data type TIME with two rows:
1, '00:00:45'
2, '00:01:15'
i.e. row 1 holds 45 seconds and row 2 holds 1 minute and 15 seconds.
If I now run the following query
SELECT AVG(tTime) from tempt
the answer I get is:
80.0000
What does that represent? And how can I get the answer I am looking for (which is 1 minute, obviously) ..?
[edit]
OK, I'm a bit slow - 80 is the average of 45 and 115... but wtf use is that to anyone? How and why does MySQL turn 00:01:15 into 115?
[edit 2]
ok, so I have to use:
SELECT AVG( 360*HOUR(tTime) + 60*MINUTE(tTime) + SECOND(tTime)) from tempt
to get the answer ins econds.
Blimey. Thank you MySQL :/