英文:
Error when querying time series data from GridDB using SQL in Ubuntu
问题
从我的时间序列表中选择 *
其中时间戳 >= '2023-01-01' 并且 时间戳 <= '2023-02-01';
我正在尝试使用Ubuntu中的SQL查询我的GridDB数据库中的时间序列数据。然而,每次执行查询时都会遇到错误。我收到的错误消息是:
> "在 'where 子句' 中未知的列 'timestamp'"。
我已经确认 'timestamp' 列存在于 'my_time_series_table' 中。可能是什么原因导致了这个错误,我该如何解决它?
<details>
<summary>英文:</summary>
```sql
SELECT *
FROM my_time_series_table
WHERE timestamp >= '2023-01-01' AND timestamp <= '2023-02-01';
I am trying to query time series data from my GridDB database using SQL in Ubuntu. However, I keep encountering an error when executing the query. The error message I receive is:
> "Unknown column 'timestamp' in 'where clause'".
I have already confirmed that the 'timestamp' column exists in the 'my_time_series_table'. What could be causing this error and how can I resolve it?
答案1
得分: 1
Timestamp是Grid DB中的一种类型,所以您需要在列名周围加上引号,以让数据库管理系统知道它是一个名称:
SELECT *
FROM my_time_series_table
WHERE "timestamp" >= '2023-01-01' AND "timestamp" <= '2023-02-01';
英文:
Timestamp is a type in Grid DB, so you will need to wrap quotes around your column name to let the db management system know it's a name:
SELECT *
FROM my_time_series_table
WHERE "timestamp" >= '2023-01-01' AND "timestamp" <= '2023-02-01';
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论