i have a requirement in which i have to get time difference of two timestamp in hours and than later find an average of the hours.
i am using below query to find difference of two timestamp but it does not give exact result it gives approx result. do we have any other solution to achieve the same.My two time stamps are as( LAST_MODIFIED_DATETIME - 2016-11-30 15:39:01.131 CREATE_DATETIME - 2016-07-01 17:25:52.375)
select timestampdiff(8, char(LAST_MODIFIED_DATETIME-CREATE_DATETIME)) as total_time from test_table where name='some name';