Gebruik de AVG
functie
SELECT avg(cast(lastprocesseddate as date)-cast(importeddate as date))
FROM feedqueueitems
WHERE eventid = 2213283
ORDER BY written DESC;
Op de database met de +1 tijdzone voor geïmporteerde datum en laatste verwerkte datum is UTC
SELECT avg(cast(cast(lastprocesseddate as timestamp with time zone) at time zone '+01:00' as date)-cast(importeddate as date))
FROM feedqueueitems
WHERE eventid = 2213283
ORDER BY written DESC;