Deletes all the rows from the named table that satisfy the search condition. If no WHERE clause is specified, all rows from the named table are deleted.
DELETE [ FROM ] [ owner.]table-name [[AS correlation-name] ...[ FROM table-expression ] [ WHERE search-condition ]] table-expression table-spec | table-expression join-type table-spec [ ON condition ] | table-expression, ...
There is a potential ambiguity in table names in DELETE statements when the FROM clauses do not both use correlation names. Consider this example:
DELETE FROM table_1 FROM table_1 AS alias_1, table_2 AS alias_2 WHERE ...
table_1 is identified without a correlation name in the first FROM clause, but with a correlation name in the second FROM clause. The use of a correlation name for table_1 in the second FROM clause ensures that only one instance of table_1 exists in the statement. This is an exception to the general rule that where the same table is identified with and without a correlation name in the same statement, two instances of the table are considered.
Now consider this example:
DELETE FROM table_1 FROM table_1 AS alias_1, table_1 AS alias_2 WHERE ...
There are two instances of table_1 in the second FROM clause. Since there is no way to identify which instance the first FROM clause should be identified with, the general rule of correlation names mean that table_1 in the first FROM clause is identified with neither instance of table_1 in the second clause: there are three instances of table_1 in the statement.
DELETE FROM Employees WHERE EmployeeID = 105
DELETE FROM FinancialData WHERE Year < 1993
DELETE FROM Contacts FROM Contacts, Customers WHERE Contacts.Surname = Customers.Surname AND Contacts.GivenName = Customers.GivenName
DELETE can be used on views provided the SELECT statement defining the view has only one table in the FROM clause and does not contain a GROUP BY clause, an aggregate function, or involve a UNION operation.