TRUNCATE
The statement removes all rows from a specified table.
Where
table_name
is an identifier (possibly qualified with a keyspace name).
- An error is raised if the specified
table_name
does not exist.
cqlsh:example> CREATE TABLE employees(department_id INT,
PRIMARY KEY(department_id, employee_id));
cqlsh:example> INSERT INTO employees(department_id, employee_id, name) VALUES (1, 1, 'John');
cqlsh:example> INSERT INTO employees(department_id, employee_id, name) VALUES (2, 1, 'Joe');
cqlsh:example> SELECT * FROM employees;
Remove all rows from the table.
cqlsh:example> SELECT * FROM employees;