Delete one row : Delete « Insert Update Delete « Oracle PL/SQL Tutorial






SQL>
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
SQL>
SQL>
SQL>
SQL>
SQL> drop table project;

Table dropped.








4.4.Delete
4.4.1.The DELETE Statements
4.4.2.Removing Rows Using the DELETE Statement
4.4.3.Delete all rows from a table
4.4.4.Delete with where clause
4.4.5.Writing a DELETE Statement Containing a Subquery
4.4.6.Delete one row
4.4.7.Deleting Row Data
4.4.8.Delete and subquery
4.4.9.To delete the records of emps whose salary is below the average salary in the department (correlated subquery):