删除特定行
DELETE FROM table_name WHERE condition;
删除所有行
DELETE FROM table_name;
确认删除
SELECT * FROM table_name WHERE condition;
示例
- 删除
DEPARTMENT
表中DEVELOPMENT
部门
DELETE FROM department WHERE dname = 'DEVELOPMENT';
- 删除
EMP
表中入职时间晚于1997年1月1日的员工
DELETE FROM emp WHERE hiredate > TO_DATE('01.1997', 'DD.MM.YYYY');
注意:
省略WHERE
子句会删除表中所有行。