taosdata / taosdata/TDengine

Interval over DIFF nested query

Open
#22,240 1 comment 0 reactions 1 assignee View on GitHub

@yu285 is already working on this.

Since Aug 14, 2023.

help wanted question
Dominant language
C
Stars
25.1k
Forks
5k
Avg merge
4d 59m
Merged PRs (30d)
7

Description

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.