DELETE

Syntax

DELETE FROM <table>
[AS <identifier>]
 [WHERE < - condition>]

For more detail, see the topic condition in this guide.

Syntax Chart

Examples

The following two examples illustrate use of the DELETE command, one with the simple condition of matching a name and the other whose condition includes a separate select command within the WHERE clause.

DELETE FROM sales.emps
WHERE  ename = 'Bert'
DELETE FROM emps
WHERE age = (select max(age)
             from emps)

Limitations

SQLstream does not allow delete from a foreign table, and DELETE does not apply to streams.

0: jdbc:farrago:rmi://localhost> select table_name,
                     tablespace_name from test1 where table_name='NEW_PARAMS';
+-------------+------------------+
| TABLE_NAME  | TABLESPACE_NAME  |
+-------------+------------------+
| NEW_PARAMS  | SYSTEM           |
+-------------+------------------+
1 row selected (0.234 seconds)
0: jdbc:farrago:rmi://localhost> delete from test1 where table_name='NEW_PARAMS';
Details: reason is [Node's traits (NONE) do not match required traits (ITERATOR)];
while preparing statement [delete from test1 where table_name='NEW_PARAMS']. (state=,code=0)