If you want to know how often (on average) a row was inserted, I don’t think you need to calculate all the differences. You just need to summarize the differences between adjacent lines (adjacent based on a timestamp) and divide the result by the number of terms.
((T1-T0) + (T2-T1) + … + (TN-TN-1)) / N
,
(TN-T0) / N
, :
SELECT TIMESTAMPDIFF(SECOND, MIN(date), MAX(date)) / (COUNT(*) - 1)
FROM atable
, 1, Division By Zero. , , :
SELECT
IFNULL(TIMESTAMPDIFF(SECOND, MIN(date), MAX(date)) / NULLIF(COUNT(*) - 1, 0), 0)
FROM atable
.