【发布时间】:2019-12-09 06:31:26
【问题描述】:
我在 influxDb 中使用两个键进行测量:operation 和 count。 operation 键可以存储两个不同的值:“添加”和“删除”。
我想将 operation='delete' 时的 sum(count) 值减去 operation='add' 时的 sum(count) 值。
mysql 支持以下查询,但在 influxql 中会抛出错误:
select (select sum(count) from measurement where operation='add') - (select sum(count) from measurement where operation='delete');
如何使用单个 influxql 查询来完成?我不认为 influxql 在这种情况下允许两个不同的 where 子句。
【问题讨论】:
-
influxDb版本为1.7