fail to delete data from TDengine

40 Views Asked by At

I want to delete some data from a table.

First, I executed the following sql:

select count(1) from dclm_device.device_int where identifier = "water_level";

I can see "Query OK, 1 rows in database"

However, when I tried to delete the data from this table, it failed.

The delete statement is :

from dclm_device.device_int where identifier = "water_level";

The output is:

DB error: invalid input

I think the statement is correct, so what may be the problem?

1

There are 1 best solutions below

0
cpvmrd On

Please refer to its development document.

https://docs.tdengine.com/taos-sql/delete-data/#

DELETE FROM [ db_name. ] tb_name [WHERE condition];

condition: Optional parameter, specifies the data filter condition. If no condition is specified all data will be deleted, so please be cautions to delete data without any condition. The condition used here is only applicable to the first column, i.e. the timestamp column.

So, the where condition you used should be a timestamp.