Delete one row : DELETE WHERE « Insert Delete Update « Oracle PL / SQL






Delete one row

  
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.

   
    
  








Related examples in the same category

1.WHERE clause is used to control which rows are affected by the DELETE statement
2.Delete command with conditions
3.Delete all records in TableA whose data in field1 and field2 DO NOT match the data in fieldx and fieldz of TableB
4.Delete clause with sub query
5.Delete statement with where clause and varchar2 type column