According to the query result align by device, can the query results of some devices be removed according to certain condition in Apache IoTDB? For example, I only want to query the data of fans 1-20 from hundreds of fans in total, and I cannot filter the data according to the fan numbers. I tried the following query statement, but the result still returns hundreds of data lines while I only want the first 20 lines.
Anyone know how to edit this statement?
select LAST_VALUE(heapId) as heapId,LAST_VALUE(bunchNo) as bunchNo,LAST_VALUE(no) as no, LAST_VALUE(voltage) as voltage,LAST_VALUE(temperature) as temperature,LAST_VALUE(soc) as soc,LAST_VALUE(soh) as soh from root.station01.cell.bms795717935384768512.bunch01.** where no > 0 and no <=20 align by device
Your SQL query will indeed remove rows where the last value of heapId
is null
, but this isn't effective at reducing the amount of data retrieved from the disk or network as this filtering is done after the fact.