I want to calculate speed at every point for each device_id, such that there is a new column of "speed" is attached to the current dataset
My dataset is like
imei(device_id) point_geom(SRID 4326) time_created
Here is my code so far:
select st_distance((points_geom::geography),lag(points_geom::geography) over (partition by imei order by time_created))
/ (time_created - lag(time_created) over(partition by imei order by time_created)) as speed
from dataset
I am receiving this error:
SQL Error [42883]: ERROR: operator does not exist: double precision / interval