I tried to execute some SQL using cnosdb.When I execute the following sql, the execution fails, I don't find the syntax error, the error message is sum(...) ... Not a "field name". Here's the sql I executed:
select
driver,
date_trunc('day',time) as c_date,
time,
load_capacity,
fuel_capacity,
sum(case when elevation<50 then elevation else 0 end) over (partition by driver)
/sum(elevation) over (partition by driver)/2
from readings
where driver in ('Seth','Albert')
and time>='2017-01-01T00:00:00'
and time<='2017-01-02T00:00:00';