0
我想獲得的時間差數學運算符
lead(time) - time
這不起作用:
SELECT
the_geom,
id,
lat,
lng,
mapid,
time,
lead(time) - time // THIS DOESNT WORK
OVER (PARTITION BY id ORDER BY time ASC)
as duration
FROM history
但這個工程:
SELECT
the_geom,
id,
lat,
lng,
mapid,
time,
-time + lead(time) // THIS WORKS
OVER (PARTITION BY id ORDER BY time ASC)
as duration
FROM history
第一個給出錯誤:
Syntax error near OVER
我不知道爲什麼會出現這種情況,誰能解釋一下?
請定義'不BTW work':'time'是一個保留字。 – wildplasser