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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.