taosdata/TDengine

Interval over DIFF nested query

Open

#22.240 geöffnet am 28. Juli 2023

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (1 zugewiesene Person)C (5.002 Forks)batch import
help wantedquestion

Repository-Metriken

Stars
 (24.849 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 1T 1h) (4 gemergte PRs in 30 T)

Beschreibung

I have a query 
 select count() as counter from (select ts, DIFF(variable_value_float) as st_count from table_name where system_uuid = '' and variable_name = '' and ts >= now - 5d and ts <= now - 3d) where st_count = 1 
 But when I want to apply an interval at the end as in example below:
 select count() as counter from (select ts, DIFF(variable_value_float) as st_count from table_name where system_uuid = '' and variable_name = '' and ts >= now - 5d and ts <= now - 3d) where st_count = 1 interval(1d)
 I have an error Window query not supported, since the result of subquery not include valid timestamp column.
 Any suggestions?

Also it will be appreciated if you could answer, how I could make a query over multiple variable_name and group by it.

Contributor Guide