Say i have a DB with 2 fields
start_time
end_time
both these contain UNIX timestamps.
i want to work out the average number of seconds between start_time and end_time.
Is it possible within one query, or will i need to do some calculation in php?
Ta
Work out average time
Moderator: General Moderators
since you are a guru I will point you in the right direction
http://dev.mysql.com/doc/mysql/en/group ... tions.html
the avg() mysql function will probably help
http://dev.mysql.com/doc/mysql/en/group ... tions.html
the avg() mysql function will probably help
seems to work
Code: Select all
SELECT AVG(time_finished - time_started) FROM responses