0

I am getting error using GROUP BY RANGE in GridDB sql. I am referring to the example mention in the doc https://griddb.org/docs-en/manuals/GridDB_SQL_Reference.html#group-by-range

name: trend_data1

ts value
2023-01-01T00:00:00 10
2023-01-01T00:00:10 30
2023-01-01T00:00:20 30
2023-01-01T00:00:30 50
2023-01-01T00:00:40 50
2023-01-01T00:00:50 70
SELECT ts, avg(value)
FROM trend_data1
WHERE ts BETWEEN TIMESTAMP('2023-01-01T00:00:00Z')
             AND TIMESTAMP('2023-01-01T00:01:00Z')
GROUP BY RANGE ts EVERY (20,SECOND)

error: The invalid query was specified

Table definition:

CREATE TABLE trend_data1 (
    ts TIMESTAMP,
    value DOUBLE
)

What is the wrong with the query as I am using the same query as provided in the document.

4
  • Please read : Why should I provide a Minimal Reproducible Example, even for a very simple SQL query? (We need the table definition, such as showing the ts columns type) Commented Nov 8 at 21:33
  • @MatBailie added the definition in the question Commented Nov 9 at 16:51
  • 1
    What version of GridDB are you using ? If I am not mistaken GROUP BY RANGE is added on GridDB CE (version 5.3). Commented Nov 10 at 9:23
  • @ErgestBasha I am using cloud GridDB version 2.0 Commented Nov 10 at 13:28

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.