【问题标题】:I would like to add column for table in Grafana and AWS Timestream我想在 Grafana 和 AWS Timestream 中添加表格列
【发布时间】:2022-11-06 18:07:23
【问题描述】:

我有来自 AWS Timestream 的这张图片的数据

所以我试图从这些数据中制作一个表格。 我写了这样的查询来添加'ntu'

SELECT CREATE_TIME_SERIES(time,measure_value::double) as ntu FROM $__database.$__table where $__timeFilter and measure_name = 'ntu'

但是我不知道如何通过查询添加更多列,例如“快门速度”、“强度”

【问题讨论】:

    标签: amazon-web-services grafana


    【解决方案1】:

    您可以像这样在 measure_name 上旋转表格:

    select device_id, time
           max(case when measure_name = 'ntu' then measure_value::double end) as ntu,
           max(case when measure_name = 'shutterspeed' then measure_value::bigint end) as shutterspeed,
           max(case when measure_name = 'intensity' then measure_value::double end) as intensity
    from $__database.$__table where $__timeFilter
    group by instance_id, time
    

    同样,您可以添加其他列

    【讨论】:

      猜你喜欢
      • 2021-07-14
      • 2022-06-27
      • 1970-01-01
      • 1970-01-01
      • 2021-01-20
      • 2019-04-05
      • 1970-01-01
      • 2020-03-30
      • 2023-02-09
      相关资源
      最近更新 更多