作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在努力处理类似 SQL 的行,而且我只是不知道如何修复它。
query = "SELECT P_askbid_midprice1, Label1 FROM 'DCIX_OB' WHERE time >= '2018-02-16T09:00:00Z' and time <= '2018-02-16T16:00:00' "
上一行出现以下错误:
Traceback (most recent call last):
File "graph_influxdb.py", line 53, in <module>
read_data(length='5min')
File "graph_influxdb.py", line 29, in read_data
result = client.query(query)
File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 394, in query
expected_response_code=expected_response_code
File "/usr/local/lib/python3.6/dist-packages/influxdb/client.py", line 271, in request
raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"error parsing query: found DCIX_OB, expected identifier at line 1, char 39"}
如何解决该问题?
最佳答案
Double quote identifiers if they start with a digit, contain characters other than [A-z,0-9,_], or if they are an InfluxQL keyword. Double quotes are not required for identifiers if they don’t fall into one of those categories but we recommend double quoting them anyway.
即使用 FROM "DCIX_OB"
(FROM DCIX_OB
也是合法的,但不推荐)。
关于mysql - 与 SQL 行作斗争,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50807763/
我是一名优秀的程序员,十分优秀!