No valid function in window query when using time window in TDengine

25 Views Asked by At

I'm trying to create a stream in TDengine.

The following statement is ok:

Select count(*),first(_ts),last_row(_ts),_value,devicecode from yxzt partiton by devicecode state_window(_value);

However, when I change the statement to the following sql, it reports an error.

Select count(*),first(_ts),last_row(_ts),_value,devicecode from yxzt partiton by rename state_window(_value);

No valid function in window query

devicecode is a tag I defined.

I need the "partition by tbname" sub-clause to create the stream, but I don't know why the clause failed.

1

There are 1 best solutions below

0
wing wing On

In your query you typed "partiton by rename" should be "partition by tbname"