ACE Director Alum Daniel Morgan, founder of Morgan's Library, is scheduling
complimentary technical Workshops on Database Security for the first 30
Oracle Database customers located anywhere in North America, EMEA, LATAM, or
APAC that send an email to
asra_us@oracle.com. Request a Workshop for
your organization today.
Basic Delete Statements
Delete All Rows
DELETE [<schema_name>.]<table_name>
or
DELETE FROM [<schema_name>.]<table_name>;
conn uwclass/uwclass@pdbdev
CREATE TABLE t AS
SELECT *
FROM all_tables;
SELECT COUNT(*)
FROM t;
DELETE FROM t;
COMMIT;
SELECT COUNT(*)
FROM t;
Delete Selective Rows
DELETE FROM [<schema_name>.]<table_name>
WHERE <filter_condition>;
conn uwclass/uwclass@pdbdev
CREATE TABLE t AS
SELECT *
FROM all_tables;
SELECT COUNT(*)
FROM t;
DELETE FROM t
WHERE table_name LIKE '%MAP';
COMMIT;
SELECT COUNT(*)
FROM t;
Delete From A SELECT Statement: May be Selective or Non-Selective Depending on whether the SELECT statement contains a WHERE clause
DELETE FROM (<SELECT Statement>);
conn uwclass/uwclass@pdbdev
CREATE TABLE t AS
SELECT *
FROM all_tables;
SELECT COUNT(*)
FROM t;
DELETE FROM (SELECT * FROM t WHERE table_name LIKE '%MAP');