a
 
SQLRef.Com 

            SqlRef.Com


SQL BASIC
DATA QUERY LANGUAGE
BASIC FUNCTION
AGGREGATE FUNCTION
DATA MANIPULATION LANGUAGE
DATA DEFINITION LANGUAGE
DATA CONTROL LANGUAGE
OTHERS

DELETE

DELETE FROM <table> [WHERE <condition>]

Data in a table can be deleted one at a time or in groups depending on the <conditions> set. If you do not put WHERE <condition>, all data in the table will be deleted. The following DELETE statement will delete Cust003 From the Customers table.

DELETE FROM Customers WHERE CustID = 'Cust003'

Table: Customers
CustID Name Address City Country PostCode Phone Fax
CUST001 Maria Anders Obere Str. 57 Berlin Germany 12209 030-0074321 030-0076545
CUST002 Ernst Handel Kirchgasse 6 Graz Austria 8010 7675-3425 7675-3426
CUST003 Helen Bennett Garden House Crowther Way Cowes UK PO31 7PJ (198) 555-8888 (198) 555-8889
CUST004 Paula Wilson 2817 Milton Dr. Albuquerque USA 87110 (505) 555-5939 (505) 555-5940
CUST005 Liu Wong 55 Grizzly Peak Rd. Butte USA 59801 (406) 555-5834 (406) 555-8083

The following DELETE statement will delete all records in Customers table.

DELETE FROM Customers



 
| Freebies | Free Trial | Add to Bookmark | Search | Link to Us |
Copyright © 2006 SqlRef.com. All rights reserved.