Skip to main content
Version: 6.0-SNAPSHOT

DELETE

The DELETE statement deletes map entries that match the condition in a given WHERE clause.

note

This statement is not atomic. If it fails, a part of the rows might be deleted and another part might remain in the table.

Syntax Summary​

This code block is a quick reference with all the parameters that you can use with the DELETE statement.

See some practical examples.

sql
DELETE FROM table_name [ [ AS ] alias ]
[ WHERE condition ]

Parameters​

The DELETE statement accepts the following parameters.

You must provide a table_name parameter.

ParameterDescriptionExample
table_nameThe table name to delete rows from.Delete Entries by Keys or Values
WHERE conditionAn optional clause that, if given, indicates the conditions that rows must satisfy to be deleted. condition is an expression that is evaluated for each row. If the expression is true, the row is selected. If there's no WHERE clause, all rows will be deleted.Delete Entries by Keys or Values

Examples​

This section lists some example SQL queries that show you how to use the DELETE statement.

Delete Entries by Keys or Values​

Currently, only IMap mappings support deleting rows.

For example, in a map that contains Employee objects as values with the following structure:

NameType
startDateINT
amountINT
titleSTRING
departmentSTRING

You can delete the entries based on the age field where the age is less than 18:

sql
DELETE FROM employees WHERE age < 18;

Whether you can access nested fields like this in objects depends on how your map entries are serialized: