The Delete statement allows you to delete a single record or multiple records from a table. After you remove records using a Delete statement, you cannot undo the operation. To check which records will be deleted, examine the results of a Select query that uses the same criteria. It is also important to understand, that a Delete statement deletes entire records, not just data in specified fields. If you just want to delete certain fields, use an Update query that changes the value to Null.
The syntax for the Delete statement is as follows:
|
Example #1
|
This example demonstrates how to totally empty a table of all records while leaving the table structure and properties, such as attributes and indexes, intact.
Example #2
|
This example is more specific and only deletes those records that meet certain criteria.
Example #3
|
This would delete all records in the Antiques table where there is a record in the orders table whose ItemDesired is Bookcase, and the OwnerID is the same as the ItemID.