在选择语句Cassandra中的where子句之后的OR条件的替代 [英] Alternative for OR condition after where clause in select statement Cassandra

查看:622
本文介绍了在选择语句Cassandra中的where子句之后的OR条件的替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Cassandra中有可能在select语句中的where子句之后使用多个条件联合在一起,如在任何RDBMS中。这是我的代码:

Is it possible in Cassandra to use multiple conditions union ed together after the where clause in a select statement like in any of the RDBMS. Here is my code :

SELECT * from TABLE_NAME WHERE COND1= 'something' OR COND2 = 'something';  


推荐答案

简单的答案:或

Simple answer: there is no equivalent of OR

http:// www。 datastax.com/docs/0.8/dml/using_cql

以下是v0.8的命令参考:

Here is the command reference for v0.8:

http://www.datastax.com/docs/0.8/references/cql #cql-reference


SELECT [FIRST N] [REVERSED] FROM [USING]
[WHERE] LIMIT N];

SELECT [FIRST N] [REVERSED] FROM [USING ] [WHERE ] [LIMIT N];

..


WHERE子句用于过滤显示在结果中的行。该子句可以对键名称或键范围进行过滤,对于索引列,对列值进行过滤。使用KEY关键字,关系运算符((=,>,> =,<和< =)之一)和术语值来指定关键字过滤器。当术语出现在关系运算符的两侧时,假定过滤器应用于索引列。使用列索引过滤器,运算符左侧的项是名称,右侧的项是要过滤的值。

The WHERE clause provides for filtering the rows that appear in results. The clause can filter on a key name, or range of keys, and in the case of indexed columns, on column values. Key filters are specified using the KEY keyword, a relational operator, (one of =, >, >=, <, and <=), and a term value. When terms appear on both sides of a relational operator it is assumed the filter applies to an indexed column. With column index filters, the term on the left of the operator is the name, the term on the right is the value to filter on.

这篇关于在选择语句Cassandra中的where子句之后的OR条件的替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆