September 15th, 2008

DELETE Syntax

Posted by admin in E. INSERT, UPDATE, DELETE

DELETE removes rows from a table.
The optional WHERE clause specifies which rows to delete.

               DELETE FROM table
               [WHERE conditions];

> DELETE removes rows from a table, but it does not delete the table’s definition.
Even if you delete all the rows in a table, the table still exists, but it is empty.
> DELETE has no column names, because it removes the entire row.
> DELETE without a WHERE clause deletes all the rows in the table. For this reason,
a delete without a where clause can be dangerous, because it is easy to do.
> Since the order of the rows is out of your control and is unimportant,
DELETE may reorder the rows. See ORDER BY to reorder your SELECTed data.
> To preserve referential integrity, the table definition can contain the action to be
taken when a row is deleted that has a FOREIGN KEY reference.

Comments are closed.

Sorry, the comment form is closed at this time.