DELETE
DELETE
is used to remove rows from a table.
Syntax
sql
DELETE FROM [db.]table WHERE expr
It removes rows from the table [db.]table
that satisfies the expression expr
after WHERE
. The removed rows are marked immediately and can’t be retrieved by all subsequent queries.
Example
For example, there is a table with the primary key host
:
sql
CREATE TABLE monitor ( host STRING, ts TIMESTAMP, cpu DOUBLE DEFAULT 0, memory DOUBLE, TIME INDEX (ts), PRIMARY KEY(host)) ;
To delete a row from it by primary key host
and timestamp index ts
:
sql
DELETE FROM monitor WHERE host = 'host1' and ts = 1655276557000;
当前内容版权归 GreptimeDB 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 GreptimeDB .