Difference between revisions of "SQL DELETE"
From Lianjapedia
m (Text replace - "Recital" to "Lianja") |
Yvonne.milne (Talk | contribs) |
||
(4 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
==Syntax== | ==Syntax== | ||
− | DELETE FROM [<database>!]<table> | + | DELETE FROM [<database>! | <database>.]<table> |
[WHERE CURRENT OF <cursor> | <condition>] | [WHERE CURRENT OF <cursor> | <condition>] | ||
==See Also== | ==See Also== | ||
− | [[ADD TABLE]], [[SQL CLOSE|CLOSE]], [[CREATE DATABASE | + | [[ADD TABLE]], [[SQL CLOSE|CLOSE]], [[CREATE DATABASE]], [[DECLARE CURSOR]], [[DROP CURSOR]], [[EXECUTE IMMEDIATE]], [[FETCH]], [[GETENV()]], [[SQL INSERT|INSERT]], [[OPEN]], [[OPEN DATABASE]], [[SET AUTOCATALOG]], [[TRUNCATE TABLE]], [[SQL UPDATE|UPDATE]], [[SQL USE|USE]] |
==Description== | ==Description== | ||
Line 15: | Line 15: | ||
To perform a DELETE operation you must have the DELETE privilege or be the owner of the table. | To perform a DELETE operation you must have the DELETE privilege or be the owner of the table. | ||
− | {| class="wikitable" | + | {| class="wikitable" width="100%" |
− | !Keywords||Description | + | !width="30%"|Keywords||Description |
|- | |- | ||
− | |database||The name of the database to which the table belongs | + | |valign="top"|database||The name of the database to which the table belongs. The '!' or '.' character must be included between the database name and the table name. |
|- | |- | ||
− | |table||The name of the table from which to delete the rows. | + | |valign="top"|table||The name of the table from which to delete the rows. |
|- | |- | ||
|WHERE||Specifies which rows are to be deleted. | |WHERE||Specifies which rows are to be deleted. | ||
|- | |- | ||
− | |CURRENT OF cursor||Deletes only the row most recently fetched by the cursor. | + | |valign="top"|CURRENT OF cursor||Deletes only the row most recently fetched by the cursor. |
|- | |- | ||
|condition||Deletes only the rows that satisfy the condition. | |condition||Deletes only the rows that satisfy the condition. |
Latest revision as of 09:50, 23 November 2017
Contents
Purpose
Deletes one or more rows from a table
Syntax
DELETE FROM [<database>! | <database>.]<table>
[WHERE CURRENT OF <cursor> | <condition>]
See Also
ADD TABLE, CLOSE, CREATE DATABASE, DECLARE CURSOR, DROP CURSOR, EXECUTE IMMEDIATE, FETCH, GETENV(), INSERT, OPEN, OPEN DATABASE, SET AUTOCATALOG, TRUNCATE TABLE, UPDATE, USE
Description
The DELETE command executes an immediate physical deletion of the specified records i.e., records are permanently removed from the table, and cannot be recalled.
To perform a DELETE operation you must have the DELETE privilege or be the owner of the table.
Keywords | Description |
---|---|
database | The name of the database to which the table belongs. The '!' or '.' character must be included between the database name and the table name. |
table | The name of the table from which to delete the rows. |
WHERE | Specifies which rows are to be deleted. |
CURRENT OF cursor | Deletes only the row most recently fetched by the cursor. |
condition | Deletes only the rows that satisfy the condition. |
Example
DELETE FROM staff WHERE ord_date < date()