【问题标题】:Grafana select query throwing error - "Found no column named time or time_sec"Grafana 选择查询抛出错误 - “找不到名为 time 或 time_sec 的列”
【发布时间】:2023-03-24 04:42:01
【问题描述】:

我正在使用 Grafana mysql 数据连接器并尝试编写选择查询。 选择查询抛出错误 - "Found no column named time or time_sec"

Here is the query
SELECT main_id, ipaddress FROM table1;

【问题讨论】:

    标签: mysql grafana grafana-templating grafana-variable


    【解决方案1】:

    当您使用“图形”可视化时会发生这种情况,将 X 轴模式设置为“时间”,因为 grafana 正在尝试查找要映射图形的时间序列:

    从您的查询来看,您似乎希望可视化没有时间序列的数据。

    取决于您正在使用的数据和您的目标

    • 将 X 轴模式更改为“系列”并选择相关的数字列来映射 X 轴
    • 或者选择比“图表”更合适的可视化效果
    • 或将查询更改为具有“时间”列

    【讨论】:

    • 我已经修改了我的查询并包含complete_dt 列如下:SELECT main_id, ipaddress, complete_dt, UNIX_TIMESTAMP(complete_dt) as time_sec FROM table1 p where p.complete_dt >= '2017-10-01'; 我现在遇到错误:Value column must have numeric datatype, column: complete_dt type: time.Time value: 2019-01-02 07:42:52 +0000 UTC
    猜你喜欢
    • 2021-07-04
    • 2018-01-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-16
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多