0
我想写一个CQL查询看起来像:如何在CQL的WHERE子句中使用基本的算术运算?
select * from mytable
WHERE timestamp >= unixTimestampOf(maxTimeuuid('2016-03-01 00:00:00')) /1000
and timestamp <= unixTimestampOf(minTimeuuid('2016-03-31 23:59:59'))/1000
,并正在此错误:如果我更改查询到
select * from mytable
WHERE timestamp >= unixTimestampOf(maxTimeuuid('2016-03-01 00:00:00'))
and timestamp <= unixTimestampOf(minTimeuuid('2016-03-31 23:59:59'))
它不
Invalid syntax at line 1, char XXX
给出任何错误,但显然我没有得到预期的结果,因为unixTimestampOf
返回毫秒,而我的timestamp
列正在存储秒。我怎样才能解决这个问题?
为什么不在'timestamp'列中存储毫秒?请注意,如果'timestamp'的列类型是'timestamp',那么您已经有了几个毫秒。 – xmas79