Delete a value or entire row

Use a `DELETE` statement to replace a value in a column with null or remove an entire row of data.

Deleted values are typically replaced by tombstones, and then removed completely by the first compaction following deletion.

INSERT/UPDATE statements that are upserts are technically a deletions because the previously stored data is deleted and replaced with the updated data.

Use a DELETE statement

  1. Delete one value from the lastname column in the cyclist_name table. The row to delete from is identified by the primary key column, id.

    DELETE lastname FROM cycling.cyclist_name
      WHERE id = c7fceba0-c141-4207-9494-a29f9809de6f;

    Only the value in lastname in the specified row is deleted.

  2. Delete an entire row from the calendar table. The row to delete is identified by the primary key column, race_id.

    DELETE FROM cycling.calendar
    WHERE race_id = 201;

    No column is specified between DELETE and FROM, so all values in the specified row are deleted.

Use TTL to expire data

You can also define a Time-To-Live (TTL) value for an individual column or an entire table. This property causes the database to delete the data automatically after a certain amount of time has elapsed. For details, see Expiring data with time-to-live.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com