Search code examples
databaseapache-iotdb

How to write count statement in Apache IoTDB to check the number of query records?


I want to check the number of records returned as query results in Apache IoTDB. I tried to use count(*) command, but multiple values are returned instead of one total value of the number of results I needed. I want to know how should I write the query statement to check the number of records in IoTDB?


Solution

  • You can use count_time(*) to query the number of timestamps in the result set of Apache IoTDB, and this should be the same as the number of records you want. When you only use count(*), it will automatically count all the fields included in the time series, which will be separately present in the query result. That's why you got multiple values instead of a number.