語法與其它的sql數據庫教程是一樣的
DELETE FROM COURSES
WHERE COURSE_DESIGNATER =
按條件比較復雜的操作方法
DELETE FROM CLASSCONVENINGS
WHERE CLASSES_NUM_FK >
AND CLASS_CONVENE_DATE = TO_DATE(
AND CLASS_LOCATION_FK =
下面來看個詳細的實例
SQL>
create demo table
SQL> create table Employee(
ID VARCHAR ( BYTE) NOT NULL
First_Name VARCHAR ( BYTE)
Last_Name VARCHAR ( BYTE)
Start_Date DATE
End_Date DATE
Salary Number( )
City VARCHAR ( BYTE)
Description VARCHAR ( BYTE)
)
/ Table created
SQL>
SQL>prepare data
SQL> insert into Employee(IDFirst_Name Last_Name Start_Date End_Date Salary City Description)
values ( Jason Martin to_date( YYYYMMDD ) to_date( YYYYMMDD ) Toronto Programmer )
/
row created SQL> insert into Employee(ID
First_Name Last_Name Start_Date End_Date Salary City Description)
values( Alison Mathews to_date( YYYYMMDD ) to_date( YYYYMMDD ) Vancouver Tester )
/
row created SQL> insert into Employee(ID
First_Name Last_Name Start_Date End_Date Salary City Description)
values( James Smith to_date( YYYYMMDD ) to_date( YYYYMMDD ) Vancouver Tester )
/
row created SQL> insert into Employee(ID
First_Name Last_Name Start_Date End_Date Salary City Description)
values( Celia Rice to_date( YYYYMMDD ) to_date( YYYYMMDD ) Vancouver Manager )
/
row created SQL> insert into Employee(ID
First_Name Last_Name Start_Date End_Date Salary City Description)
SQL> insert into Employee(ID
SQL> insert into Employee(ID
SQL> insert into Employee(ID
SQL>
SQL>
SQL>
SQL>
SQL> select * from Employee
ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL>
SQL> delete from Employee where Salary >
SQL>
SQL> select * from Employee;
ID FIRST_NAME LAST_NAME START_DAT END_DATE SALARY CITY DESCRIPTION
刪除指定的內容
SQL> CREATE TABLE project (
pro_id NUMBER( )
pro_name VARCHAR ( )
budget NUMBER( )
CONSTRAINT project_pk PRIMARY KEY (pro_id)
); Table created
SQL>
SQL>
SQL> INSERT INTO project(pro_idpro_name budget)VALUES ( A );
row created SQL> INSERT INTO project(pro_id
pro_name budget)VALUES ( ERP );
row created SQL> INSERT INTO project(pro_id
pro_name budget)VALUES ( SQL );
row created SQL> INSERT INTO project(pro_id
pro_name budget)VALUES ( CRM );
row created SQL> INSERT INTO project(pro_id
pro_name budget)VALUES ( VPN );
row created SQL>
SQL>
SQL> SET ECHO ON
SQL> DELETE
FROM project
WHERE pro_id =
From:http://tw.wingwit.com/Article/program/Oracle/201311/19072.html