How do I average MySQL result set -
i have mysql query tells me difference between status change entries:
select t1.`trackid` ticketnumber, timediff(t2.`date`, t1.`date`) difference hesk_history t1 join hesk_history t2 on t2.`trackid` = t1.`trackid` , t1.`action` = 'created' , (t2.`action` = 2)
gives me following result set:
ticketnumber difference 2013-08-12-36 410:21:25 2013-06-12-91 00:01:22 2013-08-12-50 00:00:26
how avg result set?
http://www.w3schools.com/sql/sql_func_avg.asp in case
select avg(t1.trackid
ticketnumber, timediff(t2.date
, t1.date
)) difference hesk_history t1 join hesk_history t2 on t2.trackid
= t1.trackid
, t1.action
= 'created' , (t2.action
= 2)
Comments
Post a Comment