'Is TDengine SQL support do caculate between columns and tag?
I was using TDengine for some times,and I tried to caculate some rate through the tags and columns. The follow is my table structure:
create table p(ts timestamp,voltag int)tags(nominal_voltage int);
Any calculate SQL is
select voltag/nominal_voltage from p;
but an I got the error bellow:
DB error: invalid operation: tag columns can not be used in arithmetic expression (0.001368s)
My TDengine Version is: version: 2.4.0.12.
Does some know is there any way to calculate the rate. Or is there any method that TDengine supports for this situation.
Solution 1:[1]
Sorry, the arithmetic expression is not supported for tag in TDengine. Tag is just a flag that identifies the data table.
Solution 2:[2]
I think I can store the tag value as a normal column, and then I can do arithmetic calucate between them
Solution 3:[3]
TDengine 2.x does not support calculation between column and tag. It will be improved in a 3.x re-designation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | ming |
Solution 2 | xiaolei |
Solution 3 | zitsen |