Error when querying time series data from GridDB using SQL in Ubuntu

huangapple go评论64阅读模式
英文:

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 &gt;= &#39;2023-01-01&#39; AND timestamp &lt;= &#39;2023-02-01&#39;;

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 &quot;timestamp&quot; &gt;= &#39;2023-01-01&#39; AND &quot;timestamp&quot; &lt;= &#39;2023-02-01&#39;;

huangapple
  • 本文由 发表于 2023年5月21日 07:52:11
  • 转载请务必保留本文链接:https://go.coder-hub.com/76297775.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定