Oracle 5.0 Reference Manual page 1081

Table of Contents

Advertisement

FROM
table_references
[WHERE where_condition]
Or:
DELETE [LOW_PRIORITY] [QUICK] [IGNORE]
FROM tbl_name[.*] [, tbl_name[.*]] ...
USING
table_references
[WHERE where_condition]
For the single-table syntax, the
of the number of deleted rows. This count can be obtained by calling the
(see
Section 12.13, "Information
identify which rows to delete. With no
specified, the rows are deleted in the order that is specified. The
number of rows that can be deleted.
For the multiple-table syntax,
conditions. In this case,
is an expression that evaluates to true for each row to be deleted. It is specified as
where_condition
described in
Section 13.2.8,
Currently, you cannot delete from a table and select from the same table in a subquery.
You need the
DELETE
privilege for any columns that are only read, such as those named in the
As stated, a
statement with no
DELETE
you do not need to know the number of deleted rows, is to use
a transaction or if you have a lock on the table,
can. See
Section 13.1.21,
Syntax".
UNLOCK TABLES
If you delete the row containing the maximum value for an
is reused later for a
BDB
table with
DELETE FROM tbl_name
sequence starts over for all storage engines except
to this behavior for
InnoDB
InnoDB".
For
and
tables, you can specify an
MyISAM
BDB
column key. In this case, reuse of values deleted from the top of the sequence occurs even for
tables. See
Section 3.6.9, "Using
The
statement supports the following modifiers:
DELETE
• If you specify LOW_PRIORITY, the server delays execution of the
reading from the table. This affects only storage engines that use only table-level locking (such as
MyISAM, MEMORY, and MERGE).
• For
tables, if you use the
MyISAM
during delete, which may speed up some kinds of delete operations.
• The
keyword causes MySQL to ignore all errors during the process of deleting rows. (Errors
IGNORE
encountered during the parsing stage are processed in the usual manner.) Errors that are ignored
due to the use of
IGNORE
The speed of delete operations may also be affected by factors discussed in
Statements".
DELETE
In
tables, deleted rows are maintained in a linked list and subsequent
MyISAM
reuse old row positions. To reclaim unused space and reduce file sizes, use the
DELETE
statement deletes rows from
DELETE
Functions"). The
clause, all rows are deleted. If the
WHERE
deletes from each
DELETE
and
ORDER BY
LIMIT
"SELECT
Syntax".
[577]
privilege on a table to delete rows from it. You need only the
WHERE
"TRUNCATE TABLE
table, but not for a
MyISAM
(without a
tables, as discussed in
AUTO_INCREMENT".
keyword, the storage engine does not merge index leaves
QUICK
are returned as warnings.
1061
Syntax
tbl_name
clause, if given, specifies the conditions that
WHERE
LIMIT
the rows that satisfy the
tbl_name
cannot be used.
clause deletes all rows. A faster way to do this, when
TRUNCATE
cannot be used whereas
TRUNCATE TABLE
Syntax", and
Section 13.3.5,
AUTO_INCREMENT
or
table. If you delete all rows in the
InnoDB
clause) in
WHERE
autocommit
and MyISAM. There are some exceptions
InnoDB
Section 14.2.3.3,
"AUTO_INCREMENT
secondary column in a multiple-
AUTO_INCREMENT
DELETE
and returns a count
[963]
function
ROW_COUNT()
clause is
ORDER BY
clause places a limit on the
SELECT
clause.
WHERE
TABLE. However, within
DELETE
"LOCK TABLES
and
column, the value
[436]
mode, the
Handling in
MyISAM
until no other clients are
Section 8.3.2.3, "Speed of
operations
INSERT
OPTIMIZE TABLE
[578]

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents