【发布时间】:2014-05-10 19:00:15
【问题描述】:
我有一个这样的TABLE:
id | expected | current
------+----------+--------
123 | 25 | 15
234 | 26 | 26
345 | 37 | 37
现在我想选择所有ids,其中current 等于expected。在 SQL 中,我会这样做:
SELECT id FROM myTable WHERE current = expected;
但在 CQL 中它似乎是无效的。我的cqlsh 会返回这个:
no viable alternative at input 'current'
是否有有效的 CQL 查询来实现这一点?
已编辑 根据 CQL-Docs 它应该可以工作,但它没有......这就是文档所说的:
<selectWhereClause> ::= <relation> ( "AND" <relation> )*
| <term> "IN" "(" <term> ( "," <term> )* ")"
<relation> ::= <term> <relationOperator> <term>
<relationOperator> ::= "=" | "<" | ">" | "<=" | ">="
<term> ::= "KEY"
| <identifier>
| <stringLiteral>
| <integer>
| <float>
| <uuid>
;
【问题讨论】: