I am running the following query, but there is one random result from the TIMESTAMPDIFF function that is returning a negative value, only one:
select JOB_ID,FROM_UNIXTIME(TIME_STARTED/1000) as TIME_STARTED,FROM_UNIXTIME(TIME_FINISHED/1000) as TIME_FINISHED,TIMESTAMPDIFF(SECOND,FROM_UNIXTIME(TIME_STARTED/1000, '%Y-%m-%d %h:%i:%s'),FROM_UNIXTIME(TIME_FINISHED/1000, '%Y-%m-%d %h:%i:%s')) AS DURATION from JOB;
Here's some of the data returned:
| job_201306051933_0707 | 2013-06-10 23:16:57 | 2013-06-10 23:17:06 | 9 |
| job_201306051933_0832 | 2013-06-11 10:00:47 | 2013-06-11 10:29:03 | 1696 |
| job_201306051933_0850 | 2013-06-11 12:49:57 | 2013-06-11 13:18:30 | -41487 |
Again, that last one is the only negative value returned and I'm not sure why this is. any help is appreciated.