码迷,mamicode.com
首页 > 其他好文 > 详细

Cassandra 总接归纳

时间:2016-07-05 22:33:19      阅读:241      评论:0      收藏:0      [点我收藏+]

标签:

清空表里的所有数据

Truncate falcon_gps;

TRUNCATE accepts a single argument for the column family name, and permanently removes all data from said column family.

 

查询Cassandra某表里一空有多少行记录

select count(*) from falcon_gps;

 

批量导入数据

BEGIN BATCH USING CONSISTENCY QUORUM AND TTL 8640000 INSERT INTO users (KEY, password, name) VALUES (‘user2‘, ‘ch@ngem3b‘, ‘second user‘) UPDATE users SET password = ‘ps22dhds‘ WHERE KEY = ‘user2‘ INSERT INTO users (KEY, password) VALUES (‘user3‘, ‘ch@ngem3c‘) DELETE name FROM users WHERE key = ‘user2‘ INSERT INTO users (KEY, password, name) VALUES (‘user4‘, ‘ch@ngem3c‘, ‘Andrew‘) APPLY BATCH;

 

Cassandra 总接归纳

标签:

原文地址:http://www.cnblogs.com/xxdfly/p/5645139.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!