SELECT iStop-iStart FROM(SELECT SUM(log_time) AS iStop FROM tbl WHERE status IN (2,3)) a JOIN(SELECT SUM(log_time) AS iStart FROM tbl WHERE status=1) b;
La query sopra funziona solo se la pausa o l'arresto è l'ultimo record
SELECT iStop-iStart FROM(SELECT SUM(log_time) AS iStop FROM tbl WHERE status IN (2,3)) a JOIN(SELECT SUM(log_time) AS iStart FROM tbl WHERE status=1) b;
La query sopra funziona solo se la pausa o l'arresto è l'ultimo record