是否有任何卡桑德拉查询作为同SQL:LIKE条件? [英] Is there any query for Cassandra as same as SQL:LIKE Condition?

查看:181
本文介绍了是否有任何卡桑德拉查询作为同SQL:LIKE条件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

LIKE条件允许我们在SQL语句的where子句中使用通配符。这使我们能够执行模式匹配。 LIKE条件可以在任何有效的SQL语句中使用 - 选择,插入,更新或删除。像这样


  SELECT * FROM用户
其中用户名,如巴布%';


喜欢同样的上述操作有任何疑问都可以在卡桑德拉CLI。


解决方案

答案很简单:不存在等价的 LIKE

<一个href=\"http://www.datastax.com/docs/0.8/dml/using_cql\">http://www.datastax.com/docs/0.8/dml/using_cql

下面是V0.8的命令参考:

<一个href=\"http://www.datastax.com/docs/0.8/references/cql#cql-reference\">http://www.datastax.com/docs/0.8/references/cql#cql-reference

如果您维护另一组坚持用户名引用的行:

行:用户名:BAB - >西:babu1,西:巴巴尔
行:用户名:巴布 - >西:巴布尔

有效地你被欺骗pre-填充所有你通常会用在RDBMS世界搜索结果。存储是便宜相较于以前这是什么年... ...这也是为什么现在是一个接受的方法。它的CPU和内存不够密集来检索信息的pre-填充的列表。

The LIKE condition allows us to use wildcards in the where clause of an SQL statement. This allows us to perform pattern matching. The LIKE condition can be used in any valid SQL statement - select, insert, update, or delete. Like this

SELECT * FROM users
WHERE user_name like 'babu%';

like the same above operation any query is available for Cassandra in CLI.

解决方案

Simple answer: there is no equivalent of LIKE

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

Here is the command reference for v0.8:

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

If you maintain another set of rows that hold references to a username:

row: username:bab -> col:babu1, col:babar row: username:babu -> col:babur

Effectively you are cheating by pre-populating all of the results that you would normally search with in the RDBMS world. Storage is cheap in comparison to what it was years ago ... which is why this is now an accepted approach. It's less intensive on the CPU and Memory to retrieve a pre-populated list of information.

这篇关于是否有任何卡桑德拉查询作为同SQL:LIKE条件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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