清空表里的所有数据
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‘, ‘[email protected]‘, ‘second user‘)
UPDATE users SET password = ‘ps22dhds‘ WHERE KEY = ‘user2‘
INSERT INTO users (KEY, password) VALUES (‘user3‘, ‘[email protected]‘)
DELETE name FROM users WHERE key = ‘user2‘
INSERT INTO users (KEY, password, name) VALUES (‘user4‘, ‘[email protected]‘, ‘Andrew‘)
APPLY BATCH;
时间: 2024-10-18 06:16:44