The DELETE Statement


The DELETE Statement

The DELETE statement deletes one or more rows from a table. DELETE takes the name of the table to be processed, as well as the rows to be affected.

The following example deletes a single row from a table:

 DELETE FROM products WHERE product_id=235 

The WHERE clause restricts the rows being deleted, and without it, all rows are deleted.

CAUTION

Care must be taken to ensure that a WHERE clause is specified where needed (usually it will be). If you want to delete a single row, the WHERE clause should always filter by the primary key.




Macromedia ColdFusion MX 7 Certified Developer Study Guide
Macromedia ColdFusion MX 7 Certified Developer Study Guide
ISBN: 0321330110
EAN: 2147483647
Year: 2004
Pages: 389
Authors: Ben Forta

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net