Oracle数据库删除语句DELETE的一般性用法
语法与其它的sql数据库教程是一样的,如下 DELETE FROM COURSES WHERE COURSE_DESIGNATER = 'Java110' 按条件比较复杂的操作方法 DELETE FROM CLASSCONVENINGS WHERE CLASSES_NUM_FK 4 AND CLASS_CONVENE_DATE = TO_DATE('2006-02-15 00:00:00', 'YYYY-MM-
语法与其它的sql数据库教程是一样的,如下
DELETE FROM COURSES
WHERE COURSE_DESIGNATER = 'Java110'
按条件比较复杂的操作方法
DELETE FROM CLASSCONVENINGS
WHERE CLASSES_NUM_FK > 4
AND CLASS_CONVENE_DATE = TO_DATE('2006-02-15 00:00:00',
'YYYY-MM-DD HH24:MI:SS')
AND CLASS_LOCATION_FK = 'Seattle-Training Room 1'
下面来看个详细的实例
SQL> -- create demo table
SQL> create table Employee(
2 ID VARCHAR2(4 BYTE) NOT NULL,
3 First_Name VARCHAR2(10 BYTE),
4 Last_Name VARCHAR2(10 BYTE),
5 Start_Date DATE,
6 End_Date DATE,
7 Salary Number(8,2),
8 City VARCHAR2(10 BYTE),
9 Description VARCHAR2(15 BYTE)
10 )
11 /
Table created.
SQL>
SQL> -- prepare data
SQL> insert into Employee(ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values ('01','Jason', 'Martin', to_date('19960725','YYYYMMDD'), to_date('20060725','YYYYMMDD'), 1234.56, 'Toronto', 'Programmer')
3 /
1 row created.
SQL> insert into Employee(ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values('02','Alison', 'Mathews', to_date('19760321','YYYYMMDD'), to_date('19860221','YYYYMMDD'), 6661.78, 'Vancouver','Tester')
3 /
1 row created.
SQL> insert into Employee(ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values('03','James', 'Smith', to_date('19781212','YYYYMMDD'), to_date('19900315','YYYYMMDD'), 6544.78, 'Vancouver','Tester')
3 /
1 row created.
SQL> insert into Employee(ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
2 values('04','Celia', 'Rice', to_date('19821024','YYYYMMDD'), to_date('19990421','YYYYMMDD'), 2344.78, 'Vancouver','Manager')
3 /
1 row created.
SQL> insert into Employee(ID, First_Name, Last_Name, Start_Date, End_Date, Salary, City, Description)
推荐阅读
-
oracle数据库添加或删除一列的sql语句
-
oracle数据库删除数据Delete语句和Truncate语句的使用比较
-
解决oracle数据库删除sql语句时出现^H字样的问题
-
数据库中删除语句Drop、Delete、Truncate的相同点和不同点的比较(实例说明)
-
【数据库】196. 删除重复的电子邮箱 --- delete语句
-
MySQL数据库INSERT、UPDATE、DELETE以及REPLACE语句的用法详解_MySQL
-
Oracle数据库删除语句DELETE的一般性用法
-
解决oracle数据库删除sql语句时出现^H字样的问题
-
数据库中删除语句Drop、Delete、Truncate的相同点和不同点的比较
-
Oracle数据库Delete删除千万以上普通堆表数据的方法