Oracle数据库删除语句DELETE的一般性用法
p;SQL>
SQL>
SQL>
SQL>
SQL>
SQL> -- delete command with conditions
SQL>
SQL> delete from Employee where Salary > 3000;
4 rows deleted.
SQL>
SQL> select * from Employee;
ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
---- ---------- ---------- --------- --------- ---------- ---------- ---------------
01 Jason Martin 25-JUL-96 25-JUL-06 1234.56 Toronto Programmer04 Celia Rice 24-OCT-82 21-APR-99 2344.78 Vancouver Manager
05 Robert Black 15-JAN-84 08-AUG-98 2334.78 Vancouver Tester
08 James Cat 17-SEP-96 15-APR-02 1232.78 Vancouver Tester
4 rows selected.
删除指定的内容
SQL> CREATE TABLE project (
2 pro_id NUMBER(4),
3 pro_name VARCHAR2(40),
4 budget NUMBER(9,2),
5 CONSTRAINT project_pk PRIMARY KEY (pro_id)
6 );
Table created.
SQL>
SQL>
SQL> INSERT INTO project(pro_id, pro_name, budget)VALUES (1001, 'A',1912000);
1 row created.
SQL> INSERT INTO project(pro_id, pro_name, budget)VALUES (1002, 'ERP',9999999);
1 row created.
SQL> INSERT INTO project(pro_id, pro_name, budget)VALUES (1003, 'SQL',897000);
1 row created.
SQL> INSERT INTO project(pro_id, pro_name, budget)VALUES (1004, 'CRM',294000);
1 row created.
SQL> INSERT INTO project(pro_id, pro_name, budget)VALUES (1005, 'VPN',415000);
1 row created.
SQL>
SQL>
SQL> SET ECHO ON
SQL> DELETE
2 FROM project
3 WHERE pro_id = 1006
4
零度电脑知识网www.needc.com电脑知识学习网站。电脑知识学习QQ群:81158926 欢迎电脑爱好者加入。
|