8.1. DELETE FROM Statement

The DELETE FROM statement in SQL removes zero or more rows of one table. Interactive SQL tools will tell the user how many rows were affected by an update operation, and Standard SQL requires the database engine to raise a completion condition of “no data” if there are zero rows. There are two forms of DELETE FROM in SQL: positioned and searched. The positioned deletion is done with cursors; the searched deletion uses a WHERE clause like the search condition in a SELECT statement.

8.1.1. The DELETE FROM Clause

The syntax for a searched deletion statement is:

<delete statement: searched> :: =
  DELETE FROM <table name>
  [WHERE <search condition>]

The DELETE FROM clause simply gives the name of the updatable table or view ...

Get Joe Celko's SQL for Smarties, 3rd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.