Oracle
 sql >> Datenbank >  >> RDS >> Oracle

Mittelung einer Liste von TIMESTAMP(6) WITH TIME ZONE-Zeiten

Verwenden Sie den AVG Funktion

SELECT avg(cast(lastprocesseddate as date)-cast(importeddate as date))
FROM feedqueueitems 
WHERE eventid = 2213283 
ORDER BY written DESC;

In der Datenbank mit der Zeitzone +1 für importdate und lastprocesseddate ist 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;