DELETE FROM

Deletes records from EntitySets or relationships with fields.

Syntax

DELETE [ALL] FROM SQLsetspec [EVALUATE clause] [-> clause]

Parameters

ALL

Optional. Whether or not you include the ALL argument, all records in SQLsetspec are deleted.

SQLsetspec

An SQL set specification. If omitted, records are deleted from the current set (if it exists).

Comments

DELETE FROM is the SQL version of the DELETE command.

Records cannot be deleted from a composite set. Data cannot be deleted from application documents or forms.

DELETE FROM acts by default on all records in SQLsetspec. By contrast, DELETE acts by default on only the first record in a set.

Warning: You cannot recover data deleted by the DELETE FROM command. If no backup copy of the data exists, the data is permanently lost.

Example

delete from Employees where LastName = "Smith"

Deletes every employee whose last name is Smith.

delete from Fields where Length > (select avg (length) from Fields)

Deletes every field whose length is greater than the average length of all fields.

 

Related Topics