How can I delete rows in QuasarDB?

Viewed 35

I am using QuasarDB 3.9.6 and I am storing temperature data in a table with two columns, one named “value” of type double and another named “plant”.

Here is how I created the table

CREATE TABLE sensors (value double, plant string)

I realized some test data ended up in my table and would like to remove all the data matching a specific test plant. Is it supported?

1 Answers

Data deletion is fully supported. It can be done with a DELETE statement, assuming the data you want to delete is for the plant named "test", you would write:

DELETE FROM sensors IN RANGE(2021, +1y) WHERE plant="test"

This would delete all rows matching the WHERE query for the year 2021.

Depending on your data volume, you may want to consider one table per plant and use tag based queries.

Related