【发布时间】:2020-09-29 16:04:29
【问题描述】:
我正在尝试使用以下查询从 cassandra db 中选择数据,但它失败了-
SELECT id from keyspace.table where code=123 and toTimestamp(now()) >= some_date;
Error- SyntaxException: line 1:103 no viable alternative at input '(' (...table where code=123 and [toTimestamp](...)
看起来 toTimestamp(now()) 是导致问题的原因。 有人可以建议这是什么问题和解决方案吗? 谢谢。
【问题讨论】:
-
能否将您的表架构添加到问题中。
-
实际上它通过像这样交换日期条件来工作 - SELECT id from keyspace.table where code=123 and some_date