DELETE

Documentation

Home » Documentation » Using VoltDB

DELETE

DELETE — Deletes one or more records from the database.

Synopsis

DELETE FROM table-name
[WHERE [NOT] boolean-expression [ {AND | OR} [NOT] boolean-expression]...]

Description

The DELETE statement deletes rows from the specified table that meet the constraints of the WHERE clause. The following limitations are important to note when using the DELETE statement in VoltDB:

  • The DELETE statement can operate on only one table at a time (no joins or subqueries).

  • The WHERE expression supports the boolean operators: equals (=), not equals (!= or <>), greater than (>), less than (<), greater than or equal to (>=), less than or equal to (<=), IS NULL, AND, OR, and NOT. Note, however, although OR is supported syntactically, VoltDB does not optimize these operations and use of OR may impact the performance of your queries.

Examples

The following example removes rows from the EMPLOYEE table where the EMPLOYEE_ID column is equal to 145303.

DELETE FROM employee WHERE employee_id = 145303;

The following example removes rows from the BID table where the BIDDERID is 12345 and the BIDPRICE is less than 100.00.

DELETE FROM bid WHERE bidderid=12345 AND bidprice<100.0;