使用MySQL数据库制作图形的Grafana中出现错误1064 [英] Error 1064 in Grafana for making a graph using mysql database
本文介绍了使用MySQL数据库制作图形的Grafana中出现错误1064的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Grafana绘制数据图.我有4列.时间(使用变量f),2个传感器变量(int1和int2)和ID.
I am using Grafana to make a graph of my data. I have 4 columns. The Time(using variable f), 2 sensor variables (int1 and int2) and ID.
但是我收到错误消息:
错误1064:您的SQL语法有错误;检查与您的MariaDB服务器版本相对应的手册以获取在'int1附近使用的正确语法来自数据5在哪里f在第3行的FROM_UNIXTIME(1563773333)和FROM_UNIXTIME(15'之间)
Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'int1 FROM data5 WHERE f BETWEEN FROM_UNIXTIME(1563773333) AND FROM_UNIXTIME(15' at line 3
这是生成的代码:
SELECT
f AS "time",
int1
FROM data5
WHERE
f BETWEEN FROM_UNIXTIME(1563775600) AND FROM_UNIXTIME(1563797200)
ORDER BY f
推荐答案
select created_at as time,id
from table
where created_at between FROM_UNIXTIME(1542196778) and FROM_UNIXTIME(1545893190)
ORDER BY created_at;
这应该工作
这篇关于使用MySQL数据库制作图形的Grafana中出现错误1064的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文