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

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

问题描述

在 Cassandra 中是否可以像在任何 RDBMS 中一样在 select 语句中的 where 子句之后使用多个条件联合在一起.这是我的代码:

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';  

推荐答案

简单的答案:没有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/参考文献/cql#cql-reference

从 [使用] 中选择 [第一个 N] [反转][哪里] [限制 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天全站免登陆