SQL

Check gaps between ids

SELECT a AS id, b AS next_id, (b - a) -1 AS missing_inbetween FROM ( SELECT a1.id AS a , MIN(a2.id) AS b FROM action_commerciale AS a1 LEFT JOIN action_commerciale AS a2 ON a2.id > a1.id WHERE a1.id <= 100 GROUP BY a1.id ) AS tab WHERE b > a + 1

Time

Calculer la somme de time

SEC_TO_TIME( SUM( TIME_TO_SEC( timesheet.time ) ) ) as time