DELETE FROM

Deletes rows that match the WHERE clause, from the table.

Note

The changes of the table state can’t be tracked within a single transaction. If the table has already been changed, use DELETE ON to delete the data within the same transaction.

Example

1. DELETE FROM my_table
2. WHERE Key1 == 1 AND Key2 >= "One";
3. COMMIT;

DELETE - 图1

DELETE FROM … ON

Used to delete the data, if the table has already been changed within the same transaction.

Example

1. $to_delete = (
2. SELECT Key, SubKey FROM my_table WHERE Value = "ToDelete"
3. );

5. SELECT * FROM my_table;

7. DELETE FROM my_table ON
8. SELECT * FROM $to_delete;
9. COMMIT;

DELETE - 图2