phoenix sql 中的日期查询?
date queries in phoenix sql?
你如何 select 从现在到 3 小时前(即 now-3)之间记录的观察结果?
有一列有时间戳,我指的是这个问题中的那一列。我知道 phoenix 有函数 current_time() 可以给我们当前时间但是我怎样才能从中减去 3 小时?
select col1, col2, col3
from table
where col1 between current_time() and ???;
我应该在 ???
使用什么?
Phoenix 不支持区间数据类型。
https://phoenix.apache.org/language/datatypes.html
您应该减去一个代表天数(使用小数天数)或毫秒的数字。我不记得是哪个了。
你如何 select 从现在到 3 小时前(即 now-3)之间记录的观察结果? 有一列有时间戳,我指的是这个问题中的那一列。我知道 phoenix 有函数 current_time() 可以给我们当前时间但是我怎样才能从中减去 3 小时?
select col1, col2, col3
from table
where col1 between current_time() and ???;
我应该在 ???
使用什么?
Phoenix 不支持区间数据类型。 https://phoenix.apache.org/language/datatypes.html
您应该减去一个代表天数(使用小数天数)或毫秒的数字。我不记得是哪个了。