build apps by user

Delete Formula :
Removing Entire Rows of Data from Database Tables

Delete formula is used when you want to remove some rows of data in the database tables. You can select the rows to be deleted by adding conditions.

Format (Syntax)

Delete table.* From table(s) Where criteria
Delete ClauseDelete table.*
It defines which tables which rows are to be removed if there are two or more tables in the From clause. If there is only one table, just use the keyword Delete is enough.
From ClauseFrom table(s)
It defines the tables that may need removal of data.
Where ClauseWhere criteria
It defines the conditions to select the rows of data that needs to be removed.

Example 1

Delete From Customer
This example deletes all rows of data in the Customer table.

Example 2

Delete From Customer Where Business = "AutoMobile"
This example deletes data with a condition. It only removes the Customer records in Automobile business.

Example 3

Delete Invoice.* From Customer, Invoice Where Customer.CustNo = Invoice.CustNo and Customer.Business = "AutoMobile"
This example demonstrates the removal of data when two tables are related together. It deletes the Invoice records for the Customers in Automobile business.
Since there are two tables in the From clause, Invoice.* specifies the removal of data in Invoice table only.

Example 4

Delete Customer.*, Invoice.* From Customer, Invoice Where Customer.CustNo = Invoice.CustNo and Customer.Business = "AutoMobile"
This example illustrates when data from both Customer and Invoice tables are to be deleted. Customer.*, Invoice.* is added in the Delete clause.