`
zhangljerry
  • 浏览: 141122 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Oracle Delete Statements

阅读更多
Basic Delete Statements
Delete All Rows DELETE <table_name>
or
DELETE FROM <table_name>;
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 <table_name>
WHERE <condition>;
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 DELETE FROM (<SELECT Statement>);
CREATE TABLE t AS
SELECT *
FROM all_tables;

SELECT COUNT(*)
FROM t;

DELETE FROM (
  SELECT * FROM t WHERE table_name LIKE '%MAP');

SELECT COUNT(*)
FROM t;
Delete With Returning Clause DELETE FROM (<SELECT Statement>);
CREATE TABLE t AS
SELECT *
FROM all_tables;

set serveroutput on

DECLARE
 r  urowid;
BEGIN
  DELETE FROM t
  WHERE rownum = 1
  RETURNING rowid INTO r;

  dbms_output.put_line(r);
END;
/
Delete Restricted To A Partition DELETE FROM <table_name>
PARTITION <partition_name>;
DELETE FROM sales PARTITION (q1_2001_invoices);
Delete From A Remote Database DELETE FROM <table_name>@<database_link>
DELETE FROM t@remote_db;
 
Related Topics
Conditions
Database Link
Insert
Joins
Nested Tables
Select
Types
Update
Where Clause
分享到:
评论

相关推荐

    Beginning Oracle SQL

    Written in an easygoing and example-based style, Beginning Oracle SQL is the book that will get you started down the path to successfully writing SQL statements and getting results from Oracle ...

    SQL Developer User’s Guide.pdf

    create, edit, and delete (drop) database objects; run SQL statements and scripts; edit and debug PL/SQL code; manipulate and export data; migrate third-party databases to Oracle; view metadata and ...

    plsqldev13.0.0.1882x32主程序+ v12中文包+keygen

    You can define steps, sub steps and loops to perform specific SQL statements or PL/SQL blocks to mimic the behavior of users of a specific application. For each step you can define execution ...

    ZeosDBO

    TZUpdateSQL: Analog of standard TUpdateSQL component to explicite definition of Insert/Update/Delete SQL statements for TDataset modifications. TZStoredProc: The component to execute SQL stored ...

    pdo详解(中文教程)

    它支持多种数据库管理系统,包括MySQL、PostgreSQL、Microsoft SQL Server、Oracle等。 PDO 的主要优点是: *统一的数据库访问接口,简化了数据库操作 *支持多种数据库管理系统 *提供了错误处理机制,能够灵活地...

    PLSQL.Developer v11.0.0.1762 主程序+ v10中文包+keygen

    Oracle/Logon History: Delete all items button added Tools/Recall Statement: Directory name now supports environment variables General IDE enhancements Full screen mode will now show minimized ...

    Absolute Database for D7

    DROP TABLE, ALTER TABLE statements CREATE INDEX, DROP INDEX statements INSERT, UPDATE, DELETE statements BETWEEN, IN, LIKE, IS NULL, EXISTS operators Aggregate functions COUNT,SUM,MIN,MAX,AVG Most of...

    VB编程资源大全(英文源码 数据库)

    creating Recordsets , executing SQL statements, renaming tables and many more.&lt;END&gt;&lt;br&gt;25 , CodeGen.zip VB code generator,The application currently generates data classes for Access '97 databases....

    数据库系统概念Database System Concept(英文第6版)文字版

    15.8 Insert Operations, Delete Operations, and Predicate Reads 697 15.9 Weak Levels of Consistency in Practice 701 15.10 Concurrency in Index Structures 704 15.11 Summary 708 Exercises 712 ...

    Delphi7.1 Update

    Index Open Tools API (IOTA)=d7iota.hlp Save the d7.ohi file and delete any hidden *.GID files in your Delphi7/Help folder before restarting the Help. This modification reduces the number of index ...

Global site tag (gtag.js) - Google Analytics