|
|
Deleting Rows from Tables
The DELETE statement removes rows from a table, and has the general form:
DELETE FROM table [WHERE search-condition];The search condition specifies which rows in the table are to be deleted. If no search condition is specified, all rows will be deleted (the table is emptied but not dropped).
Delete all hotels in STOCKHOLM from the HOTEL table:
DELETE FROM HOTEL WHERE CITY = 'STOCKHOLM';Delete all rows from the HOTEL table:
DELETE FROM HOTEL;Delete information for guests with the last name SVENSON from the BILL table.
DELETE FROM BILL WHERE RESERVATION IN (SELECT RESERVATION FROM BOOK_GUEST WHERE TRIM(GUEST_LNAME) = 'SVENSON');When a subselect is used in the search condition, the table from which rows are deleted may not be used in the subselect.
|
Upright Database Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 dbtechnology@upright.se |
|
|